|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-14 16:24 UTC] helly@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 16:00:01 2025 UTC |
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