note 107164 deleted from language.constants.syntax by cmb
| From: | cmb@php.net | Date: | Sun, 06 Sep 2015 15:35:34 +0000 |
| Subject: | note 107164 deleted from language.constants.syntax by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-203718@lists.php.net to get a copy of this message | ||
Note Submitter: timucinbahsi at gmail dot com
----
Constant names shouldn't include operators. Otherwise php doesn't take them as part of the
constant name and tries to evaluate them:
<?php
define("SALARY-WORK",0.02); // set the proportion
$salary=SALARY-WORK*$work; // tries to subtract WORK times $work from SALARY
?>