I've leafed through the docs and user comments on php.net, but haven't
been able to find anything related to this.
Is there a way to dynamically instantiate a class, like you can in
Java with class.forName() ?
example:
$myclass = "Automobile ";
$func = "drive";
$myInstance = new $myclass;
call_user_metho d ($func, $myInstance); // i know this is deprecated.
been able to find anything related to this.
Is there a way to dynamically instantiate a class, like you can in
Java with class.forName() ?
example:
$myclass = "Automobile ";
$func = "drive";
$myInstance = new $myclass;
call_user_metho d ($func, $myInstance); // i know this is deprecated.
Comment