Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17200 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7920 invoked by uid 1010); 8 Jul 2005 23:00:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 7904 invoked from network); 8 Jul 2005 23:00:16 -0000 Received: from unknown (HELO zend.com) (127.0.0.1) by localhost with SMTP; 8 Jul 2005 23:00:16 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:47757] helo=mail.zend.com) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id A9/9C-59389-F750FC24 for ; Fri, 08 Jul 2005 19:00:16 -0400 Received: (qmail 14255 invoked from network); 8 Jul 2005 23:00:10 -0000 Received: from internal.zend.office (HELO internal) (10.1.1.1) by internal.zend.office with SMTP; 8 Jul 2005 23:00:10 -0000 Date: Sat, 9 Jul 2005 02:00:09 +0300 (IDT) X-X-Sender: frodo@mail.zend.com To: Jessie Hernandez cc: internals@lists.php.net In-Reply-To: <59.B0.59389.F718DC24@pb1.pair.com> Message-ID: References: <84.75.05285.5EA7CC24@pb1.pair.com> <28139bc05070705364cc572f7@mail.gmail.com><26.00.59389.FF24DC24@pb1.pair.com> <59.B0.59389.F718DC24@pb1.pair.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] YANP (Yet Another Namespace Proposal) From: stas@zend.com (Stanislav Malyshev) JH>>With the above scenario, nothing will be affected if there is an JH>>opcode cache or not. The only situation I can think of where an opcode JH>>cache can affect this is when the script DYNAMICALLY creates classes JH>>from the imported namespace. Maybe there's other situations, but I JH>>can't come up with any at the moment. No, more simple - somebody removes one of the classes. Even if nothing in your code ever used it, you'd start getting errors about missing files. JH>>Either way, I'm not sure if full namespace imports are a good idea anyways. Without this, only thing you are achieving with imports is saving a couple of keystrokes. If you have to declare each imported class anyway, why not name it by the full name? Just saving a dozen of keystrokes (which any good code-completing editor would save anyway) and one require statement is not worth the trouble, IMHO. JH>>Issues like the one you presented are one reason, and the other is that it JH>>is bad practice. If multiple namespaces are imported, readability is JH>>affected (which class belongs to which namespace?). Also, if two namespaces That's a general problem with all namespace imports. JH>>are imported, and one day a new class is added to one which has the same JH>>name as another, then there will suddenly be a compile error, and the error JH>>will be elusive. Right, that's one more problem with namespace imports. -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115