|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-02-04 10:02 UTC] szepe at pinerecords dot com
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. :) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 20:00:01 2025 UTC |
How's changing a NOTICE into a WARNING going to break anything, anyway? diff -ur a/Zend/zend_constants.c b/Zend/zend_constants.c --- a/Zend/zend_constants.c 2002-10-09 16:17:53.000000000 +0200 +++ b/Zend/zend_constants.c 2003-02-05 07:46:35.000000000 +0100 @@ -265,7 +265,7 @@ if (!(c->flags & CONST_PERSISTENT)) { zval_dtor(&c->value); } - zend_error(E_NOTICE,"Constant %s already defined", lowercase_name); + zend_error(E_WARNING, "Constant %s already defined", lowercase_name); ret = FAILURE; } free_alloca(lowercase_name);