ID: 25652
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Zend Engine 2 problem
Operating System: Redhat 8
PHP Version: 5CVS-2003-09-25 (dev)
New Comment:
Opps. Bad code example -- this is the code:
<?php
function test($var) {
echo "Test $var\n";
}
class foo {
var $arr = array("test");
function bar() {
$this->arr[0]('testvalue');
}
}
$a = new foo();
$a->bar();
?>
Previous Comments:
------------------------------------------------------------------------
[2003-09-25 06:29:07] [EMAIL PROTECTED]
Description:
------------
ZE2 is bailing on with a fatal error when calling a method dyanmically
using a properity of the class (an array) as the dynamic function name.
I.e.
$this->myarr[0]("function paramer");
returns:
Fatal error: Method name must be a string in....
It worked in PHP4, so I don't know if this is intended as invalid in
PHP5, or if it is a bug...
Reproduce code:
---------------
<?php
class foo {
var $arr = array("test");
function test($var) {
echo "Test $var";
}
}
$a = new foo();
echo "<PRE>"; var_dump($a); echo "</PRE>";
$a->arr[0]("testvalue");
?>
Expected result:
----------------
Test testvalue
Actual result:
--------------
Fatal error: Method name must be a string in...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25652&edit=1