Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33989 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36003 invoked by uid 1010); 13 Dec 2007 12:22:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 35988 invoked from network); 13 Dec 2007 12:22:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Dec 2007 12:22:09 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [212.25.124.162] ([212.25.124.162:18241] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 69/62-10047-FE321674 for ; Thu, 13 Dec 2007 07:22:09 -0500 Received: (qmail 25832 invoked from network); 13 Dec 2007 12:22:04 -0000 Received: from internal.zend.office (HELO ?127.0.0.1?) (10.1.1.1) by internal.zend.office with SMTP; 13 Dec 2007 12:22:04 -0000 Message-ID: <476123EA.9030601@zend.com> Date: Thu, 13 Dec 2007 15:22:02 +0300 User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Derick Rethans CC: PHP Developers Mailing List , cellog@php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: Dropping Namespace From: dmitry@zend.com (Dmitry Stogov) Hi Derick, Now, you cannot override existing classes with "use" statement. However inside a namespace you don't have internal classes and "use" works just fine. I think it is clear decision. If you like to override internal classes just write your code in your own namespace. Allowing class overriding is possible from technical point of view (it is disabled on purpose), but it'll give more mess than advantage. Thanks. Dmitry. Derick Rethans wrote: > 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 > >