#31318 [Com]: Static method invocation with classname in a variable
| From: | the_deppchef at hotmail dot com | Date: | Tue, 28 Dec 2004 16:31:22 +0000 |
| Subject: | #31318 [Com]: Static method invocation with classname in a variable | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-71165@lists.php.net to get a copy of this message | ||
ID: 31318
Comment by: the_deppchef at hotmail dot com
Reported By: sebastian@php.net
Status: Open
Bug Type: Feature/Change Request
Operating System: Irrelevant
PHP Version: 5CVS-2004-12-28 (dev)
New Comment:
I get this strange Error:
Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM in
/home/tdc/test.php on line 9
(PHP 5.0.3)
Previous Comments:
------------------------------------------------------------------------
[2004-12-28 10:35:24] sebastian@php.net
Description:
------------
Static members of a class should be accessible even if the classname is
stored in a variable.
Reproduce code:
---------------
<?php
class Foo {
public static function bar() {
print 'Foo::bar()';
}
}
$class = 'Foo';
$class::bar();
?>
Expected result:
----------------
Foo::bar()
Actual result:
--------------
Parse error: parse error in D:\foo.php on line 9
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31318&edit=1