ID: 26802 Updated by: [EMAIL PROTECTED] Reported By: adam at trachtenberg dot com -Status: Open +Status: Verified Bug Type: Zend Engine 2 problem Operating System: * PHP Version: 5CVS
Previous Comments: ------------------------------------------------------------------------ [2004-01-05 19:49:38] [EMAIL PROTECTED] Updated test to all different versions showed that indeed one way of calling a class is wrong. class::$prop() should evaluate class::$prop and call that function. But instead it calls the method specified by the result in the class given. In other words the class name is used twice. ------------------------------------------------------------------------ [2004-01-05 17:03:57] adam at trachtenberg dot com 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26802&edit=1