Hi, To proper support this we'd have to make classes first class elements. > For making this consistent it would make sense to make functions first > class elements. And best drop the $ in front of variables and create a > new language. Everything else becomes a mess. >
Closures are first-class citizens and it seems natural that they are so. Perhaps we should rethink what consistency means for PHP. I don't see any good reason why first-class objects could be evil, except that the $ could indeed be a problem. Regards, Adrian 2011/1/6 Johannes Schlüter <johan...@php.net> > On Wed, 2011-01-05 at 21:53 -0300, Martin Scotta wrote: > > $obj = newInstance( MyClass ); // notice. undefined constant MyClass > > This describes the major change with your idea. > > What happens if a constant MyClass exists? > > Another question is something like this: > > <?php > function factory($class) { > return new $class(); > } > > factory( SomeClass ); > ?> > > > To proper support this we'd have to make classes first class elements. > For making this consistent it would make sense to make functions first > class elements. And best drop the $ in front of variables and create a > new language. Everything else becomes a mess. > > johannes > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >