Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38585 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60428 invoked from network); 24 Jun 2008 15:39:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jun 2008 15:39:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 88.198.8.16 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 88.198.8.16 bigtime.backendmedia.com Linux 2.6 Received: from [88.198.8.16] ([88.198.8.16:37499] helo=bigtime.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DF/FE-17106-C1511684 for ; Tue, 24 Jun 2008 11:39:09 -0400 Received: from localhost (unknown [127.0.0.1]) by bigtime.backendmedia.com (Postfix) with ESMTP id 18F531EBC015; Tue, 24 Jun 2008 15:41:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at backendmedia.com Received: from bigtime.backendmedia.com ([127.0.0.1]) by localhost (bigtime.backendmedia.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4l5p-hvZyVqZ; Tue, 24 Jun 2008 17:41:33 +0200 (CEST) Received: from [192.168.80.170] (unknown [195.226.16.50]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mls@pooteeweet.org) by bigtime.backendmedia.com (Postfix) with ESMTP id 957261EBC016; Tue, 24 Jun 2008 17:41:32 +0200 (CEST) Cc: Alexey Zakhlestin , Gregory Beaver , Andi Gutmans , Stanislav Malyshev , Dmitry Stogov , internals Mailing List Message-ID: <85AD9966-FDAB-4901-A039-4E991B1F2B2F@pooteeweet.org> To: Derick Rethans In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v924) Date: Tue, 24 Jun 2008 17:38:19 +0200 References: <485BD1C0.8040302@chiaraquartet.net> X-Mailer: Apple Mail (2.924) Subject: Re: [PHP-DEV] simple solution to another namespace conundrum? From: mls@pooteeweet.org (Lukas Kahwe Smith) On 24.06.2008, at 16:52, Derick Rethans wrote: > On Tue, 24 Jun 2008, Alexey Zakhlestin wrote: > >> On Tue, Jun 24, 2008 at 6:36 PM, Derick Rethans >> wrote: >>> On Fri, 20 Jun 2008, Gregory Beaver wrote: >>> >>>> The user is obviously intentionally creating a "DateTime" class, >>>> and >>>> doesn't care about the internal classname in this script. >>>> >>>> The attached patch against PHP_5_3 would fix the issue by >>>> eliminating >>>> the check for conflict with CG(class_table) in the global >>>> namespace for >>>> internal classes. It however preserves this check for userspace >>>> classes >>>> so that (for instance) php-src/tests/Zend/ns_030.phpt does not >>>> fail. >>>> The basic idea is that we do have control over the userspace >>>> classes we >>>> include, but have no control over the internal classes. >>> >>> I am not so sure this is a good idea. I mean, for the developer that >>> writes the code it's obvious that his version of DateTime is used. >>> But >>> for a second developer to come back later this could be a great WTF >>> factor a few years down the road - wondering why the DateTime >>> documentation on php.net doesn't match with what the class does. >> >> it won't be a serious 'wtf', as on the top of the file, there would >> be >> some kind of >> use MySuperLibrary::DateTime; > > I know, but 400 lines down in the code you can't really see that. This > addition might fix the immediate issue - but it doesn't make life > easier > for the developers that have to maintain the code. Even less if > they're > not aware that stuff is namespaced. I think this is the name of the game. If you want namespace magic, then you have to live with it. I am sure that editors and IDE's can easily be extended the provide some assistance here. But it does of course means that when people share code, they can no longer rely that some namespace kung-fu will not break seemingly innocent code. As such I am +1 for Greg's change. regards, Lukas Kahwe Smith mls@pooteeweet.org