|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-05 19:49 UTC] helly@php.net
[2004-02-11 05:43 UTC] zeev@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 23 05:00:02 2025 UTC |
Description: ------------ You cannot dynamically call a static methods using a variable. This works for regular functions, for example: function foo() {} $f = 'foo'; $f(); Reproduce code: --------------- class foo { static public function bar() { print "baz\n"; } } foo::bar(); $static_method = "foo::bar"; $static_method(); Expected result: ---------------- baz baz Actual result: -------------- PHP Fatal error: Call to undefined function foo::bar() in /php/test.php on line 10 baz