#24926 [Ver]: a lambda function (create_function()) cannot be stored in a class property
ID: 24926
Updated by: sniper@php.net
Reported By: kris dot hofmans at pandora dot be
Status: Verified
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5CVS-2003-11-29
New Comment:
Note: Works fine with PHP 4..
Previous Comments:
------------------------------------------------------------------------
[2003-08-03 16:37:13] kris dot hofmans at pandora dot be
Description:
------------
As soon as a lamba function created by create_function gets stored in a
class property it cannot be called anymore.
Errors while trying:
Warning: call_user_func(bleh::): First argument is expected to be a
valid callback in /home/blacky/public_html/php5-dev/callback-test.php
on line 66
And
Fatal error: Call to a member function test() on a non-object in
/home/blacky/public_html/php5-dev/callback-test.php on line 36
with test being my defined function.
The closest bug report I could find resembling this problem is:
http://bugs.php.net/bug.php?id=21909
Reproduce code:
---------------
http://bbox.homelinux.net:4000/~blacky/php5-dev/callback-test.phps
Expected result:
----------------
I'd like to store functions in a property, preferably an array and call
them like
$this->property[$index]($arg1, $arg2);
Actual result:
--------------
Warning: call_user_func(bleh::): First argument is expected to be a
valid callback in /home/blacky/public_html/php5-dev/callback-test.php
on line 66
Or
Fatal error: Call to a member function test() on a non-object in
/home/blacky/public_html/php5-dev/callback-test.php on line 36
I'd expected both cases to work, first one being more logical.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24926&edit=1
Thread (4 messages)