I need to use a constant as the class name to access this static property of the class, i.e.
class a {
public static $name = "Jon";
}
define("CLASSNAME", "a");
echo CLASSNAME::$name;
this returns an error, this class CLASSNAMEdoes not exist. Is there any solution?
source
share