Y
Yarco
There exists anonymous function, and you could also use a variable to
contain such function. But why no class?
I mean, you could do:
$func = create_function('$a', 'print $a;');
$func();
or
function test($a)
{
print $a;
}
$func = 'test';
call_user_func($func, xx);
But there is no:
$class = create_class('', '');
or
$class = 'MyClass';
class $class {}
Why?
contain such function. But why no class?
I mean, you could do:
$func = create_function('$a', 'print $a;');
$func();
or
function test($a)
{
print $a;
}
$func = 'test';
call_user_func($func, xx);
But there is no:
$class = create_class('', '');
or
$class = 'MyClass';
class $class {}
Why?