#43231 [Asn]: array-based callback syntax is overly E_STRICT

From: Date: Sun, 25 Nov 2007 20:08:48 +0000
Subject: #43231 [Asn]: array-based callback syntax is overly E_STRICT
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120047@lists.php.net to get a copy of this message
ID: 43231 Updated by: chagenbu@php.net Reported By: chuck at horde dot org Status: Assigned Bug Type: Scripting Engine problem Operating System: MacOS 10.4 PHP Version: 5.3CVS-2007-11-10 (CVS) Assigned To: johannes New Comment: Just a reminder on this, since you said you already had the patch? Previous Comments: ------------------------------------------------------------------------ [2007-11-14 08:03:15] jani@php.net And this is HEAD issue too, that's where I simply MFH'd the stuff that broke this. :) ------------------------------------------------------------------------ [2007-11-10 10:32:31] johannes@php.net I already have a patch for that, will commit that once I'll boot the other system ------------------------------------------------------------------------ [2007-11-10 03:20:27] chuck at horde dot org Description: ------------ The callback syntax of array('classname', 'methodname') for making static method calls is now enforcing E_STRICT even if E_STRICT is not on. So methods that are not explicitly declared static can't be used this way even with E_STRICT off. Putting static in front of the function makes it work, but of course results in a parse error when the code is run under PHP 4. Reproduce code: --------------- <?php class Test { function hello() { echo "hello\n"; } } call_user_func(array('Test', 'hello')); Expected result: ---------------- hello Actual result: -------------- Warning: call_user_func() expects parameter 1 to be valid callback, array given in /Users/chuck/callback.php on line 11 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43231&edit=1

« previous php.bugs (#120047) next »