note 47916 added to language.operators
| From: | roland_wirthATNOSPAMDOTwebDOTde at osu1 dot php dot net | Date: | Sun, 05 Dec 2004 12:53:33 +0000 |
| Subject: | note 47916 added to language.operators | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81390@lists.php.net to get a copy of this message | ||
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.
----
Manual Page -- http://www.php.net/manual/en/language.operators.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47916
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47916&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47916&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47916&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47916&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47916&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47916&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47916&report=yes
Search -- http://master.php.net/manage/user-notes.php