From:             kris dot hofmans at pandora dot be
Operating system: Linux 2.4
PHP version:      5CVS-2003-08-03 (dev)
PHP Bug Type:     Unknown/Other Function
Bug description:  a lamba function (create_function()) cannot be stored in a class 
property

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 bug report at http://bugs.php.net/?id=24926&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=24926&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=24926&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=24926&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24926&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24926&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24926&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24926&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24926&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24926&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24926&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24926&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24926&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24926&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24926&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24926&r=gnused

Reply via email to