I have a few problems about classes. Are there any functions equivalent to getClass().getName() in Java? In the src I saw something like PHP: new $varA($varB) . Is this constructing a new instance of a class with the name $varA?
Thanks and http://hk2.php.net/manual/en/function.get-class.php not that getName does not exist but get_class just exactly returns the class name because (I think) there is no Class<?> object in PHP
Your Question: In the src I saw something like PHP: new $varA($varB)//the variable A contain the name of the class and variable B contain the parameter of the class
So then how will this work? PHP: class Saveable { private $saveableConfig; private $saveableFilePath; public function save() { $this->saveableConfig->setAll($this->getMemory()); } public function __construct($dir,$classname=false) { if(substr($dir,-1)!='\\' and substr($dir,-1)!='/') $dir.="/"; @mkdir($dir); $this->saveableFilePath=$dir; $this->saveableConfig=new Config($dir.get_class().".yml",CONFIG_YAML,array()); if ($classname!==false) { foreach ($this->saveableConfig->getAll() as $name => $value) { $this->$name=$value; } } } public abstract function getMemory();}