#31318 [Com]: Static method invocation with classname in a variable
| From: | markus at cultcom dot de | Date: | Tue, 31 Jan 2006 14:49:42 +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-92705@lists.php.net to get a copy of this message | ||
ID: 31318
Comment by: markus at cultcom dot de
Reported By: sebastian@php.net
Status: No Feedback
Bug Type: Feature/Change Request
Operating System: Irrelevant
PHP Version: 5CVS-2004-12-28 (dev)
New Comment:
This still does'nt work and I would realy like to see this working
because it is very ugly to use
eval("return $className::method();") as a workaround...
Previous Comments:
------------------------------------------------------------------------
[2005-05-10 01:00:03] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2005-05-02 11:59:41] andrey@php.net
ReflectionAPI?
------------------------------------------------------------------------
[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