mirror of
https://github.com/php/php-src.git
synced 2026-04-29 11:13:36 +02:00
b15eff6386
As of PHP 7 old style constructor names are deprecated, so we rename mysqli::mysqli() to mysqli::__construct().
22 lines
526 B
PHP
22 lines
526 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: Access level to DB::__construct() must be public (as in class mysqli) in %s%ebug38003.php on line %d
|
|
|