Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37689 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62687 invoked from network); 16 May 2008 23:55:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2008 23:55:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:40500] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BF/67-18477-60F1E284 for ; Fri, 16 May 2008 19:55:52 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 17 May 2008 02:56:54 +0300 Received: from [192.168.16.217] ([192.168.16.217]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 16 May 2008 16:47:07 -0700 Message-ID: <482E1CB6.7030601@zend.com> Date: Fri, 16 May 2008 16:45:58 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Stan Vassilev | FM CC: internals Mailing List References: <482B9F96.7050908@gmail.com> <482CE5F8.5000700@gmail.com> <4D.AE.00945.5066D284@pb1.pair.com> <482D9F66.4000802@chiaraquartet.net> <2DA61F1F6DB245F5A628540F51AAE45F@pc> <482DDF8F.7070005@zend.com> <208411A24212429683264E1E5C89980F@pc> In-Reply-To: <208411A24212429683264E1E5C89980F@pc> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 16 May 2008 23:47:07.0711 (UTC) FILETIME=[26BC8CF0:01C8B7AF] Subject: Re: [PHP-DEV] Re: 5.3 Namespace resolution rules suggestions From: stas@zend.com (Stanislav Malyshev) Hi! > Trying to fudge the behavior of PHP to fit some kind of presumed usage > patterns is what got us features like magic quotes and register globals. You sound like these usage patterns are figment of my imagination. They are not. As for magic quotes and register globals, I understand that's very convenient argument to say "your ideas is exactly what lead to these", only this has nothing to do with current case. Yes, in past in PHP were some decisions that proved to be wrong later. But bringing them up in each discussion regardless of its relevance is not going to convince anybody. > Namespaces were introduced to solve the problems of large scale > projects, and I think anyone on this list can agree that on a large > scale project, small hacks like these are a hindrance and not an aid. It's not "small hacks". It's supporting the way PHP is used in 100% of existing code. > internal or user. But in namespace context I'll have to do something > along the lines of: > > if (function_exists('json_encode')) { > $encoded = json_encode($raw); > } else { > $encoded = ::json_encode($raw); > } What this code is supposed to do? If it's supposed to call namespace's json_encode in case global one is not defined, I see nothing wrong with it. If it is intended to call globally defined json_encode, then you just write ::json_encode, no ifs. The thing is you'd need to do it *ONLY* for json_encode, and only because you want to do something special with it. The principle is - common case is free, special cases are available, but for a "fee" - additional code. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com