Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32511 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67219 invoked by uid 1010); 1 Oct 2007 11:24:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 67204 invoked from network); 1 Oct 2007 11:24:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Oct 2007 11:24:21 -0000 Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.163 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.163 mail4.netbeat.de Received: from [83.243.58.163] ([83.243.58.163:34226] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 79/49-20852-3E8D0074 for ; Mon, 01 Oct 2007 07:24:21 -0400 Received: (qmail 26671 invoked by uid 507); 1 Oct 2007 11:24:16 -0000 Received: from unknown (HELO ?192.168.1.102?) (postmaster%schlueters.de@82.135.1.138) by mail4.netbeat.de with ESMTPA; 1 Oct 2007 11:24:16 -0000 To: Sebastian Bergmann Cc: internals@lists.php.net In-Reply-To: References: Content-Type: text/plain Date: Mon, 01 Oct 2007 13:24:10 +0200 Message-ID: <1191237850.2903.19.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-4.fc7) Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] T_IMPORT vs. T_USE From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi Sebastiann et al., 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. T_NAMESPACE is new, only T_USE wasn't removed back then. afaik. ;-) > 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? 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. 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... If we can agree on the change I can write a patch changing the token and renaming the internal stuff accordingly. johannes [1] http://www.google.com/codesearch?q=lang%3Aphp+%22-%3Eimport%28% 22&hl=en&btnG=Search+Code