bug38003.phpt 496 B

1234567891011121314151617181920
  1. --TEST--
  2. Bug #38003 (in classes inherited from MySQLi it's possible to call private constructors from invalid context)
  3. --SKIPIF--
  4. <?php if (!extension_loaded("mysqli")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. class DB extends mysqli {
  8. private function __construct($hostname, $username, $password, $database) {
  9. var_dump("DB::__construct() called");
  10. }
  11. }
  12. $DB = new DB();
  13. echo "Done\n";
  14. ?>
  15. --EXPECTF--
  16. Fatal error: Call to private DB::__construct() from invalid context in %s on line %d