Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32914 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5285 invoked by uid 1010); 22 Oct 2007 19:34:35 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5268 invoked from network); 22 Oct 2007 19:34:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Oct 2007 19:34:35 -0000 Authentication-Results: pb1.pair.com header.from=magnus@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=magnus@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.150.147.20 as permitted sender) X-PHP-List-Original-Sender: magnus@php.net X-Host-Fingerprint: 83.150.147.20 novell.stoldgods.nu Received: from [83.150.147.20] ([83.150.147.20:39808] helo=novell.stoldgods.nu) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/09-54812-94BFC174 for ; Mon, 22 Oct 2007 15:34:35 -0400 Received: from novell (novell [10.0.2.1]) by novell.stoldgods.nu (Postfix) with ESMTP id 1CD2B417; Mon, 22 Oct 2007 21:36:54 +0200 (CEST) To: internals@lists.php.net Date: Mon, 22 Oct 2007 21:34:29 +0200 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) Cc: Stanislav Malyshev References: <200710211557.48355.magnus@php.net> <471BA9AD.3010101@zend.com> In-Reply-To: <471BA9AD.3010101@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200710222134.30345.magnus@php.net> Subject: Re: [PHP-DEV] Dynamic class names and namespaces From: magnus@php.net (Magnus =?iso-8859-1?q?M=E4=E4tt=E4?=) 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(); > > ?> > > > > 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"