Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33987 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5826 invoked by uid 1010); 13 Dec 2007 10:12:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5811 invoked from network); 13 Dec 2007 10:12:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Dec 2007 10:12:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.94.239.7 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.94.239.7 mail.jdi-ict.nl Linux 2.6 Received: from [82.94.239.7] ([82.94.239.7:41194] helo=mail.jdi-ict.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/92-21071-69501674 for ; Thu, 13 Dec 2007 05:12:39 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.jdi-ict.nl (8.13.7/8.12.11) with ESMTP id lBDACZjU014274; Thu, 13 Dec 2007 11:12:35 +0100 Date: Thu, 13 Dec 2007 11:12:35 +0100 (CET) X-X-Sender: derick@kossu.ez.no To: PHP Developers Mailing List cc: cellog@php.net In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8 Subject: Re: [PHP-DEV] RFC: Dropping Namespace From: derick@php.net (Derick Rethans) Hei, now some patches by Greg and Dmitry made it into CVS, some of the things in my mail have been resolved, however, we still need to come up with a solution to the 1st and most important issue: On Tue, 4 Dec 2007, Derick Rethans wrote: > 1. As it is impossible to do "use XXX as NativeClass" we get to the > point where we'd have to namespace new internal native classes > otherwise we might introduce BC breaks. AFAIK, we've always said that > PHP reserves the globals space for it's own use (see also: > http://www.php.net/manual/en/userlandnaming.rules.php). In case we do > add new classes (an example could be DateTimeSpan), they should of > course follow the same format as already existing classes in the > extension (DateTime, DateTimeZone). However introducing the new class > DateTimeSpan might break people's code that do things like: > > use myNamespace::DateTimeZone as DateTimeZone; > ?> > > feature versions of people would then show: > > Fatal error: Cannot use myNamespace::DateTimeZone as DomDocument > because the name is already in use. > > It would be silly to require to have to do this: > > - Create a class PHP::Date::TimeSpan > - In your scripts: > use PHP::Date::TimeSpan > > But with the current implementation, this seems to be the only non-BC > breaking solution. If we chose *not* to require this silly namespacing > of internal classes, users instead have to do this: > > use myNamespace::DateTimeZone as myDateTimeZone; > ?> > > Basically prefixing the classnames... This you can already do just > fine without namespaces. I know Greg has some ideas with __php__ as recommendation, but I find it a bit clumsy still. Perhaps Greg can summarize how it will address the above issue? regards, Derick -- Derick Rethans http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org