ID: 27504 Updated by: [EMAIL PROTECTED] Reported By: redeye at erisx dot de -Status: Assigned +Status: Closed Bug Type: Zend Engine 2 problem Operating System: * PHP Version: 5CVS-2004-03-05 Assigned To: andi New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2004-03-05 07:06:04] [EMAIL PROTECTED] Andi, worth fixing this? :) ------------------------------------------------------------------------ [2004-03-05 07:00:33] redeye at erisx dot de Still the same results ( using the latest snapshot ) ------------------------------------------------------------------------ [2004-03-05 03:37:25] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip ------------------------------------------------------------------------ [2004-03-05 03:21:36] redeye at erisx dot de Description: ------------ Using call_user_func_array you are able to call a private or protected method of any object. I think this should not be allowed as it will lead to bad programming style as you could use this bug to access methods which should be hidden. Reproduce code: --------------- <?php class foo { function __construct () { $this->bar('1'); } private function bar ( $param ) { echo 'Called function foo:bar('.$param.');<br>'; } } $foo = new foo(); call_user_func_array( array( $foo , 'bar' ) , array( '2' ) ); $foo->bar('3'); ?> Expected result: ---------------- Called function foo:bar(1); Fatal error: Call to private method foo::bar() from context '' in /www/htdocs/bug.php on line 14 Actual result: -------------- Called function foo:bar(1); Called function foo:bar(2); Fatal error: Call to private method foo::bar() from context '' in /www/htdocs/bug.php on line 17 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27504&edit=1