Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40365 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10367 invoked from network); 8 Sep 2008 18:43:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2008 18:43:34 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:25663] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1A/17-13670-55275C84 for ; Mon, 08 Sep 2008 14:43:34 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 8 Sep 2008 21:44:41 +0300 Received: from [192.168.16.68] ([192.168.16.68]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 8 Sep 2008 11:44:38 -0700 Message-ID: <48C57296.6020200@zend.com> Date: Mon, 08 Sep 2008 11:44:38 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Jochem Maas CC: Elizabeth M Smith , internals@lists.php.net References: <486FA5FB.1000300@php.net> <48C55855.4080602@zend.com> <48C5624A.1040901@zend.com> <48C56743.2060706@zend.com> <48C56DDF.3060301@iamjochem.com> In-Reply-To: <48C56DDF.3060301@iamjochem.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 08 Sep 2008 18:44:38.0785 (UTC) FILETIME=[F2A37710:01C911E2] Subject: Re: [PHP-DEV] Re: towards a 5.3 release From: stas@zend.com (Stanislav Malyshev) Hi! > for the same reason you would want it with classes?? because you can > do it with classes, no? and that seems acceptable to you, no? then > functions > should have the same privilege. Functions and classes are rather different things. Class represents, as you know, group of data and behavior, function is much smaller. You have maybe two dozens of built-in classes in PHP that reside in global space, and many of them (like SPL) can be moved out relatively easily to own namespaces. You have hundreds, if not thousands, of internal functions, most of them can't be moved anywhere. So having functions imported into global space is much less useful and much more dangerous than the same for classes. It is also much less useful from one more perspective - when you import a class, you get a bunch of functions which represent functionality unit. With single function you probably get only a small piece, so if you use a library you probably have dozens of functions there. If you think importing all of them into global space through "use" is a good idea, I think you need to do some refactoring there. It would grow to be unmaintainable rather fast. I'd recommend putting them into a namespace (if for some reason you have classes) and then just use Utility::func() - it's really not that bad. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com