Why no anonymous class and other?

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,159
Messages
2,570,880
Members
47,417
Latest member
DarrenGaun

Latest Threads

Top