ID: 24926 Updated by: [EMAIL PROTECTED] Reported By: kris dot hofmans at pandora dot be -Status: Verified +Status: Closed Bug Type: Zend Engine 2 problem Operating System: * PHP Version: 5CVS-2003-11-29 New Comment:
This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Btw: Your code example is wrong because you declared the class bleh twice. Also you cannot call a non method with $this. Previous Comments: ------------------------------------------------------------------------ [2003-11-28 21:27:15] [EMAIL PROTECTED] Note: Works fine with PHP 4.. ------------------------------------------------------------------------ [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