Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32520 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8634 invoked by uid 1010); 1 Oct 2007 18:47:10 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 8619 invoked from network); 1 Oct 2007 18:47:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Oct 2007 18:47:10 -0000 Authentication-Results: pb1.pair.com header.from=andi@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=andi@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: andi@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:62039] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/24-15406-DA041074 for ; Mon, 01 Oct 2007 14:47:10 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 1 Oct 2007 20:47:05 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Mon, 1 Oct 2007 11:46:16 -0700 Message-ID: <698DE66518E7CA45812BD18E807866CEB9528E@us-ex1.zend.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] T_IMPORT vs. T_USE Thread-Index: AcgEHbQ3Ce1wPJsvS7msc31XUHxwfAAPRgHg References: <1191237850.2903.19.camel@johannes.nop> To: =?iso-8859-1?Q?Johannes_Schl=FCter?= , "Sebastian Bergmann" Cc: X-OriginalArrivalTime: 01 Oct 2007 18:47:05.0600 (UTC) FILETIME=[76756800:01C8045B] Subject: RE: [PHP-DEV] T_IMPORT vs. T_USE From: andi@zend.com ("Andi Gutmans") Hi Johannes, Our preference would be to stick to "import" because I think the = perception many will have of "use" is that it also includes files (just = based on some other languages). That said I agree that compatibility = would be an issue here. In fact it's even somewhat of an issue with = "namespace" which is probably also used quite a bit esp. in relation to = XML. What I'd like to do is see if it's feasible to support reserved words as = identifiers. It should be possible but we need to see if it makes sense, = how it affects consistency, and if we do it what identifiers we'd do it = for (or all?). We probably won't get to this until after our conference next week so my = suggestion is to keep it as-is for now and then revisit it. We're still = far enough off from the release so that we don't need to finalize today. Thx. Andi > -----Original Message----- > From: Johannes Schl=FCter [mailto:johannes@php.net] > Sent: Monday, October 01, 2007 4:24 AM > To: Sebastian Bergmann > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] T_IMPORT vs. T_USE >=20 > Hi Sebastiann et al., >=20 > On Sun, 2007-09-30 at 18:06 +0200, Sebastian Bergmann wrote: > > When we removed the namespace implementation that was scheduled for > > PHP 5.0 before PHP 5.0's release we kept the T_NAMESPACE and T_USE > > tokens for forward-compatibility. >=20 > T_NAMESPACE is new, only T_USE wasn't removed back then. afaik. ;-) >=20 > > The new namespace implementation in HEAD and PHP_5_3 uses the the > new > > T_IMPORT token instead of T_USE thus breaking code as "import" is > now > > a reserved word. > > > > We should, IMHO, drop T_IMPORT and change the namespace > implementation > > to use T_USE. > > > > Thoughts? >=20 > Well, import seems to be a word used quite often in PHP for method > names, after I found some code breaking I did a short test using > Google's Codesearch[1] to look for method calls using "->import(" and > got "about 300" results including major apps like horde, tikiwiki, > typo3 > and wordpress. >=20 > Therefor I think it's worth to at least think about using the already > reserved, but not used, keyword "use". From taking a look at the > language (the English one in this case ;-)) a sentence like "use > Namespace::SomeClass as SomeClass" makes perfect sense to me - but I > don't know much about the concept of Perl's (and other language's) > meaning of "use", BUT, we're neither Java nor Perl but PHP so we = should > use the keyword fitting best to PHP... >=20 > If we can agree on the change I can write a patch changing the token > and > renaming the internal stuff accordingly. >=20 > johannes >=20 > [1] http://www.google.com/codesearch?q=3Dlang%3Aphp+%22-%3Eimport%28% > 22&hl=3Den&btnG=3DSearch+Code >=20 > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php