Is it possible to do this?
class Foo
{
public function __construct($bar)
{
$barish = new $bar();
$barish->woo();
}
}
class Bar
{
function woo()
{
echo "wooooo";
die();
}
}
// Here the magic should happen
$foo = new Foo(Bar);
I expect wooooo but I get "Use of undefined constant Bar".