Getting static member for a class which name is stored in a variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux