note 75276 deleted from function.echo by tularis
| From: | tularis@php.net | Date: | Thu, 01 Nov 2007 09:14:42 +0000 |
| Subject: | note 75276 deleted from function.echo by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-131907@lists.php.net to get a copy of this message | ||
Note Submitter: Sean Middleditch
----
The reason is operator precedence. The . and + operators apparently have equal precedence. So the
following line:
"begin" . $var + 1 . "end"
is parsed to the equivalent of:
((("begin" . $var) + 1) . "$end")
The + 1 is being applied to the string "begin".$var, which is treated as 0 because it
doesn't start with any digits, so the end result should be "1end".
It's not a bug, just a minor misdesign (at worst).