]> granicus.if.org Git - php/commitdiff
add test for bug #38003
authorAntony Dovgal <tony2001@php.net>
Wed, 5 Jul 2006 13:31:17 +0000 (13:31 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 5 Jul 2006 13:31:17 +0000 (13:31 +0000)
ext/mysqli/tests/bug38003.phpt [new file with mode: 0644]

diff --git a/ext/mysqli/tests/bug38003.phpt b/ext/mysqli/tests/bug38003.phpt
new file mode 100644 (file)
index 0000000..af71f85
--- /dev/null
@@ -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