Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67106 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42072 invoked from network); 22 Apr 2013 08:00:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Apr 2013 08:00:32 -0000 Authentication-Results: pb1.pair.com header.from=ml@anderiasch.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ml@anderiasch.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain anderiasch.de from 81.169.138.148 cause and error) X-PHP-List-Original-Sender: ml@anderiasch.de X-Host-Fingerprint: 81.169.138.148 ares.art-core.org Linux 2.5 (sometimes 2.4) (4) Received: from [81.169.138.148] ([81.169.138.148:47099] helo=mail.anderiasch.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 05/E0-46657-D1EE4715 for ; Mon, 22 Apr 2013 04:00:30 -0400 Message-ID: <5174EE1C.2030002@anderiasch.de> Date: Mon, 22 Apr 2013 10:00:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130413 Icedove/17.0.5 MIME-Version: 1.0 To: Robert Stoll CC: 'Igor Wiedler' , internals@lists.php.net References: <5170E1F8.9060203@sugarcrm.com> <000e01ce3ee3$597521f0$0c5f65d0$@tutteli.ch> In-Reply-To: <000e01ce3ee3$597521f0$0c5f65d0$@tutteli.ch> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: AW: [PHP-DEV] Importing namespaced functions From: ml@anderiasch.de (Florian Anderiasch) On 04/22/2013 12:55 AM, Robert Stoll wrote: > I agree with Igor. The readability could be improved and I do not see the > problem of hiding built-in php functions (however, I would not recommend > it). > I would say, if someone hides the normal php built-in function then he or > she is doing that on purpose and is aware of the consequences. Thus it is > also fine if the same person imports the function, which hides the normal > php built-in function, in another namespace. Huge +1 from me. I know that using only functions instead of OOP in PHP has this 90s-PHP3-Vibe to it, but as a matter of fact you can write mostly side-effect free code using only functions in PHP. This would make using functions much more flexible and even more importantly, consistent to everything else. The only downside to this proposal, as Stas correctly mentioned is that it would allow people to shoot themselves in the foot when using weird import behavior. But as you deliberately have to misuse this I don't see any real harm. Something like instance variable shadowing in Java is much, much more error-prone and still hardly anyone complains about this kind of feature. Greetings, Florian