Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20989 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11624 invoked by uid 1010); 2 Dec 2005 07:42:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 11608 invoked from network); 2 Dec 2005 07:42:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Dec 2005 07:42:12 -0000 X-Host-Fingerprint: 195.225.34.5 fw01.axit.nl Received: from ([195.225.34.5:10244] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 8F/C6-14828-4DAFF834 for ; Fri, 02 Dec 2005 02:42:12 -0500 Message-ID: <8F.C6.14828.4DAFF834@pb1.pair.com> To: internals@lists.php.net References: Date: Fri, 2 Dec 2005 08:41:52 +0100 Lines: 77 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-RFC2646: Format=Flowed; Original X-Posted-By: 195.225.34.5 Subject: Re: [PHP-DEV] phpnamespaces.org! From: r.korving@xit.nl ("Ron Korving") I assume ::: is being used because it simply works and the discussion on which seperator to use might still go on for some time ;). You have a point about import statements being allowed only in the beginning. This would be nice: class X { public function foo() { import class bar:::MyClass; $obj = new MyClass(); $obj->doSomething(); } } This would be nice, because __autoload() only needs to be called if my method foo() is being called. bar:::MyClass is not a dependency for the whole file, but only for X::foo(). Performance-wise it would be a good thing if importing namespaces would not extend the dependency to the whole file. Also, it could prevent unnecessary aliasing: class X { public function foo() { import class bar:::MyClass; $obj = new MyClass(); $obj->doSomething(); } public function fubar() { import class bla:::MyClass; $obj = new MyClass(); $obj->doSomething(); } } In this example, bar:::MyClass and bla:::MyClass are used. Two different classes, each in their own namespace. Aliasing is not required, because the imported namespaces are limited to the scope of the methods foo() and fubar(). - Ron "Marian Kostadinov" schreef in bericht news:bec76cf90512012309u6e85d2dcg@mail.gmail.com... First I must say - a nice job:) The namespaced version works fine. I found just 3 problems (things I don't like): 1.Import statements are allowed only in the beginning of the script. 2.Global function calls are not allowed in a namespace. 3.The example below does not work. Anyway, the patch seems to be stable. Also ::: is veeery long. I wrote it a lot of times and usually I got :: instead of :::