note 47916 deleted from language.operators by sean
| From: | sean@php.net | Date: | Sun, 05 Dec 2004 14:39:05 +0000 |
| Subject: | note 47916 deleted from language.operators by sean | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-81397@lists.php.net to get a copy of this message | ||
Note Submitter: roland_wirth AT NOSPAM DOT web DOT de
----
Also, pay attention when using the . operator.
As +, - and . have equal precedence,
<?php
$i = 3;
echo '$i + 1 = '. $i+1 .';';
?>
will result in "1;", because '$i + 1 = '.$i is converted to int (which is 0),
then 1 is added, the result is converted to string and ';' is appended.
Took me a few hours to figure this out.
----
Reason: useless note