Re: Dynamic class names and namespaces

From: Date: Sun, 21 Oct 2007 19:34:05 +0000
Subject: Re: Dynamic class names and namespaces
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-32905@lists.php.net to get a copy of this message
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... -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#32905) next »