ID: 22047 Comment by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Assigned Bug Type: *General Issues Operating System: Linux PHP Version: 4.3.0 Assigned To: derick New Comment:
Good, thanks. Let me clarify - PHP does log a NOTICE such as [04-Feb-2003 17:18:22] PHP Notice: Constant T_LIST already defined in x.php on line 3 but this definitely needs to be a WARNING or even an ERROR. -Tomas Previous Comments: ------------------------------------------------------------------------ [2003-02-04 10:13:58] [EMAIL PROTECTED] That is a good idea, thought it did that. Assigned. ------------------------------------------------------------------------ [2003-02-04 10:09:56] [EMAIL PROTECTED] Hmm. I'm convinced PHP should at least file a big fat warning upon any attempted redefinition of a reserved constant name, instead of ignoring the instruction entirely. Identifiers such as T_LIST are very often used in enums. ------------------------------------------------------------------------ [2003-02-04 10:05:43] [EMAIL PROTECTED] The tokenizer extension needs those, and changing it now would be breaking all scripts that make use of it. So there is little we can do here... Derick ------------------------------------------------------------------------ [2003-02-04 10:02:59] [EMAIL PROTECTED] Since 4.3.0, PHP defines constants that are suspiciously similar to its grammar tokens. These cannot be redefined and should clearly be considered namespace pollution. For instance, the following example: <? echo T_LIST, ", ", T_STRING, "\n"; ?> will output '345, 304'. Needless to say, this broke one of my PHP creations horribly. :) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22047&edit=1
