For example is something like this possible in PHP?
class foo
{
public $something;
}
$class_name = "foo";
$f = new $class_name;
For example is something like this possible in PHP?
class foo
{
public $something;
}
$class_name = "foo";
$f = new $class_name;
Yes, works fine.
Was it really easier to ask this here than to just test it?
That should work, yes.
You can also do:
$f = new $class($arg1,$arg2);