Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40375 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73905 invoked from network); 8 Sep 2008 21:34:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2008 21:34:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=auroraeosrose@shitennou.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=auroraeosrose@shitennou.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain shitennou.com from 208.83.222.18 cause and error) X-PHP-List-Original-Sender: auroraeosrose@shitennou.com X-Host-Fingerprint: 208.83.222.18 unknown Linux 2.6 Received: from [208.83.222.18] ([208.83.222.18:50151] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/E5-46475-26A95C84 for ; Mon, 08 Sep 2008 17:34:26 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id 1DEB891E131; Mon, 8 Sep 2008 14:33:41 -0700 (MST) Received: from [192.168.1.101] (24-247-219-180.dhcp.cdwr.mi.charter.com [24.247.219.180]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id A460F91E130; Mon, 8 Sep 2008 14:33:40 -0700 (MST) Message-ID: <48C59A7D.50201@shitennou.com> Date: Mon, 08 Sep 2008 17:34:53 -0400 User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Stanislav Malyshev CC: internals@lists.php.net References: <486FA5FB.1000300@php.net> <48C55855.4080602@zend.com> <48C5624A.1040901@zend.com> <48C56743.2060706@zend.com> <48C56821.2040805@shitennou.com> <48C5695E.1010404@zend.com> <48C56A51.1000307@shitennou.com> <48C56CEE.6050807@zend.com> <48C56DED.4010407@shitennou.com> <48C57045.6020003@zend.com> <48C5715C.2070102@shitennou.com> <48C574E8.1030504@zend.com> <48C57761.5030708@shitennou.com> <48C57F58.3060703@zend.com> In-Reply-To: <48C57F58.3060703@zend.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] Re: towards a 5.3 release From: auroraeosrose@shitennou.com (Elizabeth M Smith) Stanislav Malyshev wrote: > Hi! > >> Bottom line, being able to alias in functions the same way you can >> classes would be useful. You could also shoot yourself in the foot. >> >> You can alias in classes. You can shoot yourself in the foot with that >> as well. > > As I already noted in my response to Jochem, there's a difference > between classes and functions. With functions, the possibility of foot > injury is much higher, and possibility of any better outcome, not > available easily by other means, is much lower. We try to find a balance > here, between allowing as many things as possible and turning whole > thing into a mess where one could find no ends. I think the balance lies > where it is today - maybe dropping functions from namespaces wouldn't > upset the balance too much, even improve it, but since I feel better > allowing than not allowing I am ready to tolerate them. :) > > However, importing function names is both dangerous (clashes), bad style > (you don't really want to override global strlen, really) and > impractical (functions come in libraries, how 50 imports would look? are > you ready to maintain huge import list for every function you ever > mention in your code?). It does appear to have small convenience value - > but IMHO not nearly enough to outweight potential downsides. I'm going to have huge use lists anyway - however I think some clever class_alias use will become widespread to fake use * in libraries. > And I'm sorry for repeating it ad nauseam, but I still don't have any > explanation why old_foo() is so much better than Old::foo(). Without > understanding that it is hard to understand why one needs to import > functions in global space. Here's a quick use case for you -> you have a group of "helper functions" for a PHP based template system. You want to have those functions in "global scope" for the template (and yes, you might want to override strlen) and no, you don't want your templates to be using static calls into namespaced functions. Thanks, Elizabeth