Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86485 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56886 invoked from network); 4 Jun 2015 08:02:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jun 2015 08:02:28 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.174 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.214.174 mail-ob0-f174.google.com Received: from [209.85.214.174] ([209.85.214.174:34680] helo=mail-ob0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 48/22-32964-21600755 for ; Thu, 04 Jun 2015 04:02:27 -0400 Received: by obew15 with SMTP id w15so27078861obe.1 for ; Thu, 04 Jun 2015 01:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=lsTu+kJcqfbXiSIB71q9eZPEyj3GCRndIBMx9sskGGE=; b=qrO1XLiMFDsfUhFThOjBKBPjQcillpk963QAL1uhQYVqmffqBzZfKwzBeFBr0q62Os e/6kUxhQqCLGb3KFfqsXsZENXma1auLwmRCKV7CUDftWYUqSW/DMLi/1AbhLukvd0xfT S3Le5zduGVht55XXffPb5Rx2a/8G2tIAiGsn9op819hr/AjIghpwwhvnJlhqxFGpqwJT QbfFYwRr4ANvURAdLJ/5LdTOM96srF3/NZ3tO5MMXLOnT6O+1SlBAN0zEAbfbcjUCHjO eFjDhGwADqrcXGCbCJLdsXyQ9z9cu6PgSCknAb690M+G487OIjR7Quz64aWGVItGdqyA TvTQ== X-Received: by 10.202.10.193 with SMTP id 184mr7475053oik.90.1433404943708; Thu, 04 Jun 2015 01:02:23 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.202.170.196 with HTTP; Thu, 4 Jun 2015 01:01:43 -0700 (PDT) In-Reply-To: References: Date: Thu, 4 Jun 2015 17:01:43 +0900 X-Google-Sender-Auth: Je4XtxSzvP40qeJUE_neL2Lvs7Y Message-ID: To: Sara Golemon Cc: Dominic Grostate , PHP internals Content-Type: multipart/alternative; boundary=001a113d1dc67d399d0517ac988e Subject: Re: [PHP-DEV] Migrating PHP classes to built in namespace From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a113d1dc67d399d0517ac988e Content-Type: text/plain; charset=UTF-8 Hi all, On Thu, Jun 4, 2015 at 12:07 AM, Sara Golemon wrote: > On Wed, Jun 3, 2015 at 1:33 AM, Dominic Grostate > wrote: > > Has there been any discussion or consideration towards migrating or at > > least aliasing all built in classes to a Php vendor namespace? > > > Not any that's led to a consensus. > > Personally, I like the idea of moving EVERYTHING to PHP\ at once and > building in an automatic fallback, so an app could do: > > $dt = new DateTime(...); // uses builtin DataTime via fallback to PHP > namespace > > Or: > > class DateTime { ... } > $mydt = new DateTime(...); // Uses user supplied DateTime > $pdt = new PHP\DateTime(...); // Uses builtin DateTime > It's acceptable option, but I prefer explicit declaration for clean root namespace. > > Possibly paired with the ability to import a NS to root: > > use PHP as \; > $pdt = new DateTime(...); // Uses builtin DateTime from root namespace +1 for "as \" It achieves both clean namespace and compatibility at the same time. It opens door for easier API version up also. Automatic fallback disturbs this. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a113d1dc67d399d0517ac988e--