lundi 16 février 2015

ReflectionClass changes name of class and causes fatal error

Getting some serious wierdness when using reflection to get a class instance. The code is so simple I really dont get where this is going wrong, it would seem that reflection is changing the class name. So:



$reflect = new ReflectionClass($class);
print_r($reflect);
ReflectionClass Object
(
[name] => Db_Table_Data_Binding
)

return $reflect->newInstance(); // fatal error class Db_Table_Binding Not Found


even if I wrap it in a if statement to confirm:



if($class === "Db_Table_Data_Binding")
{
return $reflect->newInstance(); // fatal error class Db_Table_Binding
}


Cant really see whats going on here... Any help would be great.






Aucun commentaire:

Enregistrer un commentaire