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üter [mailto:[EMAIL PROTECTED] > 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 > > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php