Re: Migrating PHP classes to built in namespace

From: Date: Wed, 03 Jun 2015 15:07:34 +0000
Subject: Re: Migrating PHP classes to built in namespace
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-86478@lists.php.net to get a copy of this message
On Wed, Jun 3, 2015 at 1:33 AM, Dominic Grostate <codekestrel@googlemail.com> 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: <?php $dt = new DateTime(...); // uses builtin DataTime via fallback to PHP namespace Or: <?php class DateTime { ... } $mydt = new DateTime(...); // Uses user supplied DateTime $pdt = new PHP\DateTime(...); // Uses builtin DateTime Possibly paired with the ability to import a NS to root: <?php use PHP as \; $pdt = new DateTime(...); // Uses builtin DateTime from root namespace I don't feel strongly about any of this though, so I'm not personally inclined to push any RFC to make it happen. -Sara

« previous php.internals (#86478) next »