mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
add test
This commit is contained in:
parent
81cf3b0d69
commit
1e5849ca94
20
ext/mysqli/tests/bug38003.phpt
Normal file
20
ext/mysqli/tests/bug38003.phpt
Normal file
@ -0,0 +1,20 @@
|
||||
--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: Call to private DB::__construct() from invalid context in %s on line %d
|
Loading…
Reference in New Issue
Block a user