note 85882 added to tokens

From: Date: Mon, 22 Sep 2008 20:08:52 +0000
Subject: note 85882 added to tokens
Groups: php.notes 
Request: Send a blank email to php-notes+get-144625@lists.php.net to get a copy of this message
T_ENCAPSED_AND_WHITESPACED is returned when parsing strings with evaluated content, like "some $value" or this example from the Strings reference page: <?php echo <<<EOT My name is "$name". I am printing some $foo->foo. Now, I am printing some {$foo->bar[1]}. This should print a capital 'A': \x41 EOT; ?> This last example is tokenized as: T_ECHO echo T_WHITESPACE %20 (a space character) T_START_HEREDOC << T_ENCAPSED_AND_WHITESPACE My name is " T_VARIABLE $name T_ENCAPSED_AND_WHITESPACE ". I am printing some T_VARIABLE $foo T_OBJECT_OPERATOR -> T_STRING foo T_ENCAPSED_AND_WHITESPACE . Now, I am printing some T_CURLY_OPEN { T_VARIABLE $foo T_OBJECT_OPERATOR -> T_STRING bar (terminal) [ T_LNUMBER 1 (terminal) ] (terminal) } T_ENCAPSED_AND_WHITESPACE . This should print a capital 'A': \x41 T_END_HEREDOC EOT (terminal) ; ---- Server IP: 195.221.21.36 Probable Submitter: 2a01:e35:2eed:9850:f9cb:518e:e3eb:2b53 ---- Manual Page -- http://www.php.net/manual/en/tokens.php Edit -- https://master.php.net/note/edit/85882 Del: integrated -- https://master.php.net/note/delete/85882/integrated Del: useless -- https://master.php.net/note/delete/85882/useless Del: bad code -- https://master.php.net/note/delete/85882/bad+code Del: spam -- https://master.php.net/note/delete/85882/spam Del: non-english -- https://master.php.net/note/delete/85882/non-english Del: in docs -- https://master.php.net/note/delete/85882/in+docs Del: other reasons-- https://master.php.net/note/delete/85882 Reject -- https://master.php.net/note/reject/85882 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#144625) next »