blob: f1efa56b301733a8feaab79071aaf9e0a8afa888 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
--TEST--
Bug #38003 (in classes inherited from MySQLi it's possible to call private constructors from invalid context)
--SKIPIF--
<?php if (!extension_loaded("mysqli")) print "skip"; ?>
--FILE--
<?php
class DB extends mysqli {
private function __construct($hostname, $username, $password, $database) {
var_dump("DB::__construct() called");
}
}
$DB = new DB();
echo "Done\n";
?>
--EXPECTF--
Fatal error: Uncaught exception 'EngineException' with message 'Call to private DB::__construct() from invalid context' in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
|