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
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
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
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