Forum Moderators: coopster
Looks simple, but can't figure out the best way to do that other than having a temporary variable.
This is the sample code that works:
<?phpclass A_test {
function b() {
echo 'it worked';
}
}
$a = new A_test();
$a->b();
This is the same with dynamic helper name, that I want to achieve:
<?phpclass A_test {
function b() {
echo 'it worked';
}
}
$mode = 'A';
$a = new $mode.'_test'();
$a->b();
any way to make the parser understand what I want?
P.S. new ${$mode.'_test'}() didn't work.