#36011 [Asn->Csd]: Strict errormsg wrong for call_user_func() and the likes
| From: | helly@php.net | Date: | Sat, 14 Jan 2006 15:24:20 +0000 |
| Subject: | #36011 [Asn->Csd]: Strict errormsg wrong for call_user_func() and the likes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-91914@lists.php.net to get a copy of this message | ||
ID: 36011
Updated by: helly@php.net
Reported By: phpbugreport at elexer dot com
-Status: Assigned
+Status: Closed
Bug Type: Class/Object related
Operating System: *
PHP Version: 5CVS-2006-01-14 (snap)
Assigned To: helly
New Comment:
This bug has been fixed in CVS.
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/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2006-01-14 15:48:19] sniper@php.net
Exactly what PHP version are you using? I don't get any errors when I
run the script using PHP 5.1.2.
------------------------------------------------------------------------
[2006-01-14 15:42:38] phpbugreport at elexer dot com
Description:
------------
With error_reporting(E_ALL | E_STRICT) and usage of call_user_func(),
array_map() on a static function returns "Strict Standards: Non-static
method TestClass::test() cannot be called statically, assuming $this
from compatible context TestClass" while the called method is static.
Reproduce code:
---------------
<?php
error_reporting(E_ALL | E_STRICT);
class TestClass {
static function test() {
echo "test() called\r\n";
}
function whee() {
array_map(array('TestClass', 'test'), array('array_value'));
}
function whee4() {
call_user_func( Array('TestClass', 'test') );
}
static function whee5() {
call_user_func( Array('TestClass', 'test') );
}
}
TestClass::test();
$a = new TestClass();
$a->whee();
$a->whee4();
$a->whee5();
TestClass::whee5();
Expected result:
----------------
No strict warnings
Actual result:
--------------
Strict Standards: Non-static method TestClass::test() cannot be called
statically, assuming $this from compatible context TestClass in
test2.php on line 11 test() called
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36011&edit=1