mirror of
https://github.com/php/php-src.git
synced 2025-01-06 02:43:34 +08:00
24 lines
539 B
PHP
24 lines
539 B
PHP
--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 Error: Call to private DB::__construct() from invalid context in %s
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %s
|