Getting static member for a class which name is stored in a variable
| From: | Francisco M. Marzoa Alonso | Date: | Thu, 25 Nov 2004 16:49:45 +0000 |
| Subject: | Getting static member for a class which name is stored in a variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-202859@lists.php.net to get a copy of this message | ||
I've code like follows:
<?php
class TestClass {
public static $Data = 'This is the data';
}
$Obj = new TestClass ();
$ClassName = get_class ($Obj);
echo $ClassName::$Data;
?>
It gives me an error like:
Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM ...
I've found googling that it means that those '::' are unexpected. So, How can I get an static member for a class which name is stored in a variable?
Thx.