Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20874 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50523 invoked by uid 1010); 30 Nov 2005 07:55:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 50508 invoked from network); 30 Nov 2005 07:55:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Nov 2005 07:55:38 -0000 X-Host-Fingerprint: 198.237.84.92 unknown Linux 2.4/2.6 Received: from ([198.237.84.92:1845] helo=bobsilva.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id A4/50-14828-7FA5D834 for ; Wed, 30 Nov 2005 02:55:36 -0500 Received: from [198.237.84.93] (HELO jake) by bobsilva.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 684371 for internals@lists.php.net; Tue, 29 Nov 2005 20:34:41 -0800 To: Date: Tue, 29 Nov 2005 23:53:25 -0800 Message-ID: <000601c5f583$2490afb0$5d54edc6@jake> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0007_01C5F540.166D6FB0" X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcX1gySCY/RzuBPASfSzMNPCKiNLuQ== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 Subject: Desired namespace behavoir From: me@bobsilva.com ("Bob Silva") ------=_NextPart_000_0007_01C5F540.166D6FB0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Looking for some feedback on what the expected behavior should be for class and/or constant ambiguity within namespaces. For instance: Classes.php: namespace A { const FOO = 123; class Bar { . } class FooBaz { . } } namespace B { const FOO = 456; class Bar { . } class FooBar { . } } class Bar { . } define('FOO', 789); File.php: import namespace A; import namespace B; $c = new Bar(FOO); // ambiguous classname/constant Compile-time error on namespace B import? Or runtime error on ambiguous class creation? Jessie, how does your patch handle it? Looking at the modules patch, it appears to be a compile time error when the second class is defined since it is based on zend_class_entry and CG(class_tables). Also, neither patch has scoped imports, they are global. Is this the "preferred" method? Maybe it's the only method, not sure yet, still scratching the surface here. Bob ------=_NextPart_000_0007_01C5F540.166D6FB0--