#26802 [NEW]: Can't call static method using a variable
| From: | adam at trachtenberg dot com | Date: | Mon, 05 Jan 2004 22:03:57 +0000 |
| Subject: | #26802 [NEW]: Can't call static method using a variable | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-52828@lists.php.net to get a copy of this message | ||
From: adam at trachtenberg dot com
Operating system: *
PHP version: 5.0.0b3 (beta3)
PHP Bug Type: Zend Engine 2 problem
Bug description: Can't call static method using a variable
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 bug report at http://bugs.php.net/?id=26802&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26802&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26802&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26802&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26802&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26802&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=26802&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=26802&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26802&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26802&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26802&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26802&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26802&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26802&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26802&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26802&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26802&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26802&r=float