tony2001                Wed Jul  5 14:12:41 2006 UTC

  Modified files:              
    /php-src/ext/mysqli/tests   bug38003.phpt 
  Log:
  add test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug38003.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/mysqli/tests/bug38003.phpt
diff -u /dev/null php-src/ext/mysqli/tests/bug38003.phpt:1.2
--- /dev/null   Wed Jul  5 14:12:41 2006
+++ php-src/ext/mysqli/tests/bug38003.phpt      Wed Jul  5 14:12:41 2006
@@ -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

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to