Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33936 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6506 invoked by uid 1010); 11 Dec 2007 22:36:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 6491 invoked from network); 11 Dec 2007 22:36:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2007 22:36:19 -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.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:20784] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/82-17330-0E01F574 for ; Tue, 11 Dec 2007 17:36:19 -0500 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 12 Dec 2007 00:36:14 +0200 Received: from [192.168.16.91] ([192.168.16.91]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 11 Dec 2007 14:36:11 -0800 Message-ID: <475F10DA.6000909@zend.com> Date: Tue, 11 Dec 2007 14:36:10 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: =?ISO-8859-1?Q?David_Z=FClke?= CC: internals@lists.php.net References: <11970653983080000@9866357972520000.9866341568840000> <475BDDF1.7040605@ctindustries.net> <1723341090.20071210220025@marcus-boerger.de> <1197323296.3922.5.camel@sbarrow-desktop> <00A2E2156BEE8446A81C8881AE117F199A0715@companyweb> <475ED038.3080004@zend.com> <7F9E1E02-FF89-474B-9E94-007747B3637A@bitxtender.com> <475EF175.2030304@zend.com> <475F01B1.8090407@zend.com> <31696FA6-ADC3-4853-A5AE-23FA16750B3D@bitxtender.com> In-Reply-To: <31696FA6-ADC3-4853-A5AE-23FA16750B3D@bitxtender.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 11 Dec 2007 22:36:11.0080 (UTC) FILETIME=[3ABB7480:01C83C46] Subject: Re: AW: [PHP-DEV] Namespace resolution From: stas@zend.com (Stanislav Malyshev) > import Name::Space; > // only stuff from Name::Space available, no PHP internal stuff > import __php__; > // now PHP's classes are loaded, too. So "import php" make internal classes always take priority even when there's a class in this namespace by that name? But you could achiever the same just by avoiding naming classes the same as internal classes, you surely know which classes are in your own namespace? Since in both cases code change is needed, why that one is better? If you created Name::Space::DateTime, surely there was some intent in having it named specifically the same as DateTime class in PHP? > issues. My statement 'doing a "use __php__" is not a tall order' (which > means it's not asking much from the developer to do that) from one of Not using names of classes same as internal classes is not a big deal either - all PHP programmers do it right now :) I just don't see any added value in inventing artificial syntax constructs which don't do what they implied meaning is (they don't import anything) but instead change engine rules. > the previous mails was referring to just that. Think of other languages > with namespace/package concepts. If you want to use java's date/time > features, you need to do some kind of import java.util.blah stuff, too. Java package system is very different. For starters, they don't have global space at all. And they have offline compilation stage which verifies all the dependencies. > I don't think that PHP's internal stuff needs to be magically available. > We can force developers to explicitly request access to it. We can, but we should not. Internal classes are internal for a reason - people use them a lot. Making it hard to access frequently used classes to enable rarely used functionality is not the right way to go. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com