Is something like the following possible in PHP?
$blah = \'foo1\';
class foo2 extends $blah {
//...
}
class foo1 {
//...
}
This g
I know this question was asked a long time ago, but the answer is relatively simple.
Assuming you want to extend class foo if class foo exists, or class bar if it doesn't, you'd use:
if(!class_exists('foo')) {
class foo extends bar {
function __construct() {
parent::__construct();
}
}
}
class myclass extends foo{
//YOUR CLASS HERE
}
you should have tried $$
$blah = 'foo1';
class foo2 extends $$blah {
//...
}
class foo1 {
//...
}