Re: Clarifying the resolution rules

From: Date: Tue, 28 Oct 2008 08:16:59 +0000
Subject: Re: Clarifying the resolution rules
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-41499@lists.php.net to get a copy of this message
History has shown us that breaking code (e.g. PHP4 - PHP5) slows adoption of new versions.
Bad example as PHP4 > 5 broke existing code. No existing code has namespaces in it. Anyway: ---------------- A yet another compromise is possible as the lesser evil: Resolution for classes: namespace Foo; new Bar(); 1) Try to find class Foo\Bar. 2) Try to autoload class Foo\Bar. 3) Try to fallback to global *internal or user* class Bar + E_NOTICE; namespace Foo; $result = bar(); 1) Try to find function Foo\bar(). 2) Try to fallback to global *internal or user* function bar(). They key change is: not to make difference between internal and user global functions, just fall back to global ones, so that there's no additional confusion among drop-in replacements, user resources, and internal resources. Send feedback. Thanks. Stan Vassilev

« previous php.internals (#41499) next »