ID: 31023
Updated by: [EMAIL PROTECTED]
Reported By: jan dot reitz at lanxess dot com
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
Operating System: Windows 2000
PHP Version: 5.0.3RC1
New Comment:
It was never supposed to work, so this is not a bug.
Use call_user_func_array(Array('MyClass','myMethod'),Array(&$var));
instead.
Previous Comments:
------------------------------------------------------------------------
[2004-12-08 15:06:22] jan dot reitz at lanxess dot com
Description:
------------
i have defined a method in 'myClass' named 'myMethod' and it can be
called statically.
i cant use call_user_func() because i need to pass a variable by
reference and since call_user_func() is a function itself i cant get
the variable passed (if i add the "&" to the variable in call_user_func
i get a "calltime-pass-by-reference" error in php5, but it works for
now)
tried with 4.3.8 and 5.0.3RC1
Reproduce code:
---------------
Generates Error:
<?
$meth = 'myMethod';
is_callable(array('myClass',$meth),null,$callname);
echo $callname($variable);
?>
Works:
<?
echo myClass::myMethod($variable);
?>
Expected result:
----------------
myClass::myMethod() should be called
Actual result:
--------------
PHP Fatal error: Call to undefined function myClass::myMethod() in XXX
on line XXX
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31023&edit=1