#38064 [NEW]: available private constructor access

From: Date: Tue, 11 Jul 2006 11:56:51 +0000
Subject: #38064 [NEW]: available private constructor access
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-99323@lists.php.net to get a copy of this message
From: instance at o2 dot pl Operating system: Windows XP, Linux PHP version: 5.1.4 PHP Bug Type: Class/Object related Bug description: available private constructor access Description: ------------ Private __construct() can be called form inherited class constructor via parent::__construct(); I'm not sure, this was not reported, but I didn't found any this kind. Also in PHP version 5.2 this was occured (not by me). Thx. Reproduce code: --------------- <?php class A{ private function __construct(){} } class B extends A{ public function __construct(){ parent::__construct(); } } $instance=new B(); ?> Expected result: ---------------- Fatal error: Call to private method A::__construct() from context 'B' Actual result: -------------- no error - everything is fine -- Edit bug report at http://bugs.php.net/?id=38064&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38064&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38064&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38064&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38064&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38064&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38064&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38064&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38064&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38064&r=support Expected behavior: http://bugs.php.net/fix.php?id=38064&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38064&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38064&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38064&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38064&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38064&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38064&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38064&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38064&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38064&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38064&r=mysqlcfg

« previous php.bugs (#99323) next »