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

From: Date: Wed, 30 Jan 2008 18:02:20 +0000
Subject: #43231 [Opn->Asn]: array-based callback syntax is overly E_STRICT
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121789@lists.php.net to get a copy of this message
ID: 43231 Updated by: tony2001@php.net Reported By: chuck at horde dot org -Status: Open +Status: Assigned Bug Type: Scripting Engine problem Operating System: MacOS 10.4 PHP Version: 5.3CVS-2007-11-10 (CVS) -Assigned To: +Assigned To: colder Previous Comments: ------------------------------------------------------------------------ [2008-01-17 06:11:28] chagenbu@php.net Ping? ------------------------------------------------------------------------ [2007-11-25 20:08:47] chagenbu@php.net Just a reminder on this, since you said you already had the patch? ------------------------------------------------------------------------ [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 (#121789) next »