Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67118 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26871 invoked from network); 24 Apr 2013 06:15:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2013 06:15:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=martin.keckeis1@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=martin.keckeis1@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.47 as permitted sender) X-PHP-List-Original-Sender: martin.keckeis1@gmail.com X-Host-Fingerprint: 209.85.219.47 mail-oa0-f47.google.com Received: from [209.85.219.47] ([209.85.219.47:55703] helo=mail-oa0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/22-05234-76877715 for ; Wed, 24 Apr 2013 02:15:04 -0400 Received: by mail-oa0-f47.google.com with SMTP id n9so1336513oag.34 for ; Tue, 23 Apr 2013 23:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=PtMgXxPhW8JHaFjncRMK05fh8k197NqakJnvN0W+uBo=; b=vCav7AZIRqj8t+FZGY1yVSPBaFCnglaOJjVSBYOxwnC/JurOx5NsSk4JRITMeZrV+D fXvELr2ZZ6KkxhFYmnxKSiB1VHPxHThTXBeqBu6pXm6vKbwe3p8vmc6lcEh2TRopUbk8 mS2cae5CrWx941w3YJbLxkZQAzwnPJTLAxLT/YYbiVyDtiuQ9j6Gaq7dBVbhMFy84S9F ENIf3w3E+xRleRS0mIIdrj0FVE5M+UXE6e3eQk8YrK27mZTdYZMvBfu22Bk6lPQkRgG5 9o4BBggSdY1ovhmqDN1rEOg50B+k2ygz5YITIip962wyNEHu/Fnr0k2hdUVfpJAB7+dP 89Lg== MIME-Version: 1.0 X-Received: by 10.182.44.227 with SMTP id h3mr15497985obm.16.1366784100254; Tue, 23 Apr 2013 23:15:00 -0700 (PDT) Received: by 10.182.88.105 with HTTP; Tue, 23 Apr 2013 23:15:00 -0700 (PDT) In-Reply-To: References: <5170E1F8.9060203@sugarcrm.com> <000e01ce3ee3$597521f0$0c5f65d0$@tutteli.ch> <5174EE1C.2030002@anderiasch.de> Date: Wed, 24 Apr 2013 08:15:00 +0200 Message-ID: To: Daniele Orlando Cc: Florian Anderiasch , Robert Stoll , Igor Wiedler , PHP Development Content-Type: multipart/alternative; boundary=001a11c2f402c8199404db1538c9 Subject: Re: AW: [PHP-DEV] Importing namespaced functions From: martin.keckeis1@gmail.com (Martin Keckeis) --001a11c2f402c8199404db1538c9 Content-Type: text/plain; charset=UTF-8 Hello together, if you got a namespace with more than one functions, why not just create a container class and make the methods static? I know it's not exactly the same, but how many times you need this.... So you can write: namespace Abc\Def; class Something{ public static function blubb(); public static function blubb2(); } use Abc\Def\Something; Something::blubb(); Something::blubb2(); Best regards Martin 2013/4/23 Daniele Orlando > +1 > > The current behavior is really annoying. > > > 2013/4/22 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 > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > --001a11c2f402c8199404db1538c9--