note 89513 deleted from function.define by cmb
| From: | cmb@php.net | Date: | Sun, 06 Oct 2019 07:55:23 +0000 |
| Subject: | note 89513 deleted from function.define by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212483@lists.php.net to get a copy of this message | ||
Note Submitter: ceo at l-i-e dot com
----
In PHP 4.4.9, you cannot use certain names for constants.
Specifically, reserved words such as 'PRINT', 'IF', etc.
Oddly enough, you get different behaviour for some:
<?php
define('IF', 42);
echo "IF: ", IF, "<hr />\n";
?>
yields PHP Parse error: syntax error, unexpected T_IF
<?php
define('PRINT', 13);
echo "PRINT: ", PRINT, "<hr />\n";
?>
yields PHP Parse error: syntax error, unexpected ')'
Not sure if this is still true in PHP 5 or not, but it's worth noting if it is.