ID: 27504 User updated by: redeye at erisx dot de Reported By: redeye at erisx dot de -Status: Feedback +Status: Open Bug Type: Zend Engine 2 problem Operating System: Windows, Linux -PHP Version: 5.0.0b4 (beta4) +PHP Version: 5.0.0rc1-dev New Comment:
Still the same results ( using the latest snapshot ) Previous Comments: ------------------------------------------------------------------------ [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