Re: [PHP-DEV] Dynamic class names and namespaces

2007-10-22 Thread Stanislav Malyshev
Ahh, I see, that's a bit disappointing. Any reason why it doesn't/shouldn't work ? Yes. Test::Foo is a class name, so you can't make part of it variable and part not, just as you couldn't write: $var = "bar"; $a = new foo$var(); and expect new instance of class "foobar". You'd have to compos

Re: [PHP-DEV] Dynamic class names and namespaces

2007-10-22 Thread Magnus Määttä
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: > > > > > namespace test; > > class Foo {} > > $class = "Foo"; > > $foo = new test::$class(); > > ?> > > > > Wi

Re: [PHP-DEV] Dynamic class names and namespaces

2007-10-21 Thread Stanislav Malyshev
Using dynamic class names works fine without namespaces, but doesn't work at all with namespaces. Take this simple example: 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

[PHP-DEV] Dynamic class names and namespaces

2007-10-21 Thread Magnus Määttä
Hello, Using dynamic class names works fine without namespaces, but doesn't work at all with namespaces. Take this simple example: Will produce the following message: Fatal error: Class 'test::test' not found in foo.php on line Y Now if Foo would have a static method and we want to use dynamic