On Sunday 21 October 2007, Stanislav Malyshev wrote:
> > Using dynamic class names works fine without namespaces, but
> > doesn't work at all with namespaces. Take this simple example:
> > 
> > <?php
> > namespace test;
> > class Foo {}
> > $class = "Foo";
> > $foo = new test::$class();
> > ?>
> > 
> > Will produce the following message:
> > Fatal error: Class 'test::test' not found in foo.php on line Y
> 
> I don't think partially variable class name is supposed to work. It is 
> interesting though how the engine managed to parse this at all...

Ahh, I see, that's a bit disappointing. Any reason why it doesn't/shouldn't
work ?

/Magnus

-- 
One of the most striking differences between a cat and a lie is that a cat has
only nine lives.
                -- Mark Twain, "Pudd'nhead Wilson's Calendar"

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to