#40790 [Opn->Bgs]: List interface parsed as T_LIST instead of T_STRING
| From: | tony2001@php.net | Date: | Mon, 12 Mar 2007 23:16:46 +0000 |
| Subject: | #40790 [Opn->Bgs]: List interface parsed as T_LIST instead of T_STRING | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-110277@lists.php.net to get a copy of this message | ||
ID: 40790
Updated by: tony2001@php.net
Reported By: markpk at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
PHP Version: 5.2.1
New Comment:
http://www.php.net/manual/en/reserved.php
There are reserved words and you have to remember of them when naming
you classes/functions.
>I think the engine could be made a little smarter by..
Stas was kind enough to write a comprehensive answer on this, so I
won't duplicate it.
You can find it here: http://news.php.net/php.internals/28303
Previous Comments:
------------------------------------------------------------------------
[2007-03-12 23:02:23] markpk at gmail dot com
Description:
------------
An object named List, named after a common data structure, is parsed as
a T_LIST. I know many PHP applications use list(), but I think the
engine could be made a little smarter by checking if this T_LIST could
_also_ be a T_STRING in cases like these:
interface List
{
...
}
and:
function anything(List $x)
{
,,,
}
It will be appreciated if the engine detects the user is declaring an
object named List and thus not parsing it as a T_LIST in this case.
Because List is the name of a common data structure, it is a little bit
annoying to see PHP displays a parse error instead of recognizing it as
a T_STRING.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40790&edit=1