note 85872 added to tokens
| From: | nathan at unfinitydesign dot com | Date: | Mon, 22 Sep 2008 12:52:07 +0000 |
| Subject: | note 85872 added to tokens | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-144606@lists.php.net to get a copy of this message | ||
T_ENCAPSED_AND_WHITESPACE is whitespace which intersects a group of tokens. For example, an
"unexpected T_ENCAPSED_AND_WHITESPACE" error is produced by the following code:
<?php
$main_output_world = 'snakes!'
echo('There are' 10 $main_output_world);
?>
Note the missing concatenation operator between the two strings leads to the whitespace error that
is so named above. The concatenation operator instructs PHP to ignore the whitespace between the two
code tokens (the so named "encapsed" data"), rather than parse it as a token itself.
The correct code would be:
<?php
$main_output_world = 'snakes!'
echo('There are' . 10 . $main_output_world);
?>
Note the addition of the concatenation operator between each token.
----
Server IP: 209.41.74.194
Probable Submitter: 86.137.13.84
----
Manual Page -- http://www.php.net/manual/en/tokens.php
Edit -- https://master.php.net/note/edit/85872
Del: integrated -- https://master.php.net/note/delete/85872/integrated
Del: useless -- https://master.php.net/note/delete/85872/useless
Del: bad code -- https://master.php.net/note/delete/85872/bad+code
Del: spam -- https://master.php.net/note/delete/85872/spam
Del: non-english -- https://master.php.net/note/delete/85872/non-english
Del: in docs -- https://master.php.net/note/delete/85872/in+docs
Del: other reasons-- https://master.php.net/note/delete/85872
Reject -- https://master.php.net/note/reject/85872
Search -- https://master.php.net/manage/user-notes.php