From: terjeto at stud dot ntnu dot no Operating system: RedHat 9.0 PHP version: 5CVS-2003-06-22 (dev) PHP Bug Type: Zend Engine 2 problem Bug description: using array from class as function name
Description: ------------ When using a string from an array inside an class for calling a function it results in a fatal error. Reproduce code: --------------- <?php class Foo { var $_array = array( 'function' => array ( 'spacer' => array( 0 => '_funk' ) ) ); } function _funk( $arg ) { print( $arg ); } $_out = array( 'function' => array ( 'spacer' => array( 0 => '_funk' ) ) ); _funk( "Test string 1<br>" ); $foo = new Foo(); $foofunk = $foo->_array['function']['spacer'][0]; $foofunk( "Test string 2<br>" ); $_out['function']['spacer'][0]( "Test string 3<br>" ); $foo->_array['function']['spacer'][0]( "Test string 4<br>" ); ?> Expected result: ---------------- Test string 1 Test string 2 Test string 3 Test string 4 Actual result: -------------- Test string 1 Test string 2 Test string 3 Fatal error: Method name must be a string in /var/ www/html/test.php on line 22 -- Edit bug report at http://bugs.php.net/?id=24286&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=24286&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=24286&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24286&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24286&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24286&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24286&r=support Expected behavior: http://bugs.php.net/fix.php?id=24286&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24286&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24286&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24286&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24286&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24286&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24286&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24286&r=gnused