bug38003.phpt 490 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Bug #38003 (in classes inherited from MySQLi it's possible to call private constructors from invalid context)
  3. --EXTENSIONS--
  4. mysqli
  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: Uncaught Error: Call to private DB::__construct() from global scope in %s
  17. Stack trace:
  18. #0 {main}
  19. thrown in %s