note 75276 added to function.echo

From: Date: Mon, 21 May 2007 23:37:16 +0000
Subject: note 75276 added to function.echo
Groups: php.notes 
Request: Send a blank email to php-notes+get-126808@lists.php.net to get a copy of this message
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). ---- Server IP: 69.147.83.197 Probable Submitter: 71.238.87.27 ---- Manual Page -- http://www.php.net/manual/en/function.echo.php Edit -- https://master.php.net/note/edit/75276 Del: integrated -- https://master.php.net/note/delete/75276/integrated Del: useless -- https://master.php.net/note/delete/75276/useless Del: bad code -- https://master.php.net/note/delete/75276/bad+code Del: spam -- https://master.php.net/note/delete/75276/spam Del: non-english -- https://master.php.net/note/delete/75276/non-english Del: in docs -- https://master.php.net/note/delete/75276/in+docs Del: other reasons-- https://master.php.net/note/delete/75276 Reject -- https://master.php.net/note/reject/75276 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#126808) next »