Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31207 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29890 invoked by uid 1010); 23 Jul 2007 16:42:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 29875 invoked from network); 23 Jul 2007 16:42:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2007 16:42:36 -0000 Authentication-Results: pb1.pair.com header.from=d.giedrius@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=d.giedrius@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.146.176 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: d.giedrius@gmail.com X-Host-Fingerprint: 209.85.146.176 wa-out-1112.google.com Received: from [209.85.146.176] ([209.85.146.176:24647] helo=wa-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/35-27148-C7AD4A64 for ; Mon, 23 Jul 2007 12:42:36 -0400 Received: by wa-out-1112.google.com with SMTP id l24so2270798waf for ; Mon, 23 Jul 2007 09:42:33 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=daLyAlRWUKdzzBAVJv9KOhWGgjIIqbnWXVJvgg5QbwUf2laraJFJFpw8bge29cw/KQLA5+mFcQTHTM9WyJ5dwbyiBICxmRjzqsYz3Pg84liUO4eN4yZwyEg7C8WHtLDfmf2O56CSQunLuEghdRXcgyXWA1/0jz97Hujz+s3WnKk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=HqNAAgTeYm1kU4nr0Ii36rmaPfulcAViw66kRXjWRLjrlX3bNQ5P6xVwE3ux760o+onCUkL5diyJF4Zn2mzxAfT/gb6C6JhKqxg9fpWbP1ZrjX0a2w4/H0oZUtVSCEp6PGRJzX/AaOISoBeWTrXVHScuQaVO1NFFAgUifAHOT1c= Received: by 10.114.36.1 with SMTP id j1mr3162789waj.1185208952229; Mon, 23 Jul 2007 09:42:32 -0700 (PDT) Received: by 10.114.144.12 with HTTP; Mon, 23 Jul 2007 09:42:31 -0700 (PDT) Message-ID: <3d1a63d10707230942y2b2504d1p5f995f01d28a622b@mail.gmail.com> Date: Mon, 23 Jul 2007 19:42:31 +0300 To: "Brian Moon" Cc: "=?ISO-8859-1?Q?David_Z=FClke?=" , "PHP Internals" In-Reply-To: <46A4C090.50402@php.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <46A31D95.2080407@fischer.name> <46A4661A.6080202@zend.com> <200707231140.55535.pstradomski@gmail.com> <46A4BA4F.6090506@dealnews.com> <40CA6572-030F-43E2-8706-64D1167C527C@bitxtender.com> <46A4C090.50402@php.net> Subject: Re: [PHP-DEV] Question about Namespace patch From: d.giedrius@gmail.com ("Giedrius D") On 7/23/07, Brian Moon wrote: > David Z=FClke wrote: > > Oh yes, sure, that must be the main point about namespaces - I can use > > "::" instead of "_" as a delimiter! Yay! > > If all you are going to do is: > > > include "MyClass.php"; > import MyClass; > > ?> > > Then why use a namespace? I really don't see the point. Namespaces are > doing nothing for you in this case. It is not always in your power to decide if you need namespace or not. If you use some lib from Vendor1 there's a good chance that all lib is in Vendor1 name= space you want it or not. If you use that Vendor1 lib in one.php file a lot you clutter your code wit= h Vendor1::A, Vendor1::B, Vendor1::C, etc. It is possible to rename Vendor1 to something shorter using import but you still have to prefix it. Now as import has effect only in file where it was used it would be nice to import all names from Vendor1 to the file one.php where it is heavy used an= d not to the ones that include one.php. So if the second.php file includes one.php global namespace is not cluttered with names from Vendor1 namespace. Only with names from one.php (if its names ar= e not in some namespace by them selves.) This way second.php may include&impo= rt some lib from Vendor2 to accomplish its tasks without even worrying about l= ibs used in one.php. That's why people sometimes want to import *all* names from namespace. Regards, Giedrius