RE: [PHP-DEV] T_IMPORT vs. T_USE
| From: | Andi Gutmans | Date: | Thu, 18 Oct 2007 06:17:49 +0000 |
| Subject: | RE: [PHP-DEV] T_IMPORT vs. T_USE | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-32843@lists.php.net to get a copy of this message | ||
Main problem I have right now after digging deeper is that any such "fix" in the parser
will mean that tokenizers and syntax highlighters will not treat keywords like "import"
correctly. Fixing this would require them to do parsing which in many cases you don't want to
do. There are a lot of utilities and tools which depend on such behavior.
Even if it's just for this reason it may be better if we stick to the "a keyword is a
keyword" rule and don't try and outsmart ourselves (other languages like C have discovered
the same issues and stuck to the keyword only rule too). So it may make most sense to go ahead and
use "use".
Andi
> -----Original Message-----
> From: Stanislav Malyshev [mailto:stas@zend.com]
> Sent: Wednesday, October 17, 2007 12:58 PM
> To: Sebastian Nohn
> Cc: Andi Gutmans; Johannes Schlüter; Sebastian Bergmann;
> internals@lists.php.net
> Subject: Re: [PHP-DEV] T_IMPORT vs. T_USE
>
> > Are there already any results on these checks?
>
> Looks like we have the simple patch that allows to use "import" as
> method name, function name and class name. If we didn't discover any
> problems with it then import stays.
> --
> Stanislav Malyshev, Zend Software Architect
> stas@zend.com http://www.zend.com/
> (408)253-8829 MSN: stas@zend.com