note 126012 added to language.basic-syntax.phpmode
| From: | coder at fishlet dot com | Date: | Thu, 15 Apr 2021 22:03:16 +0000 |
| Subject: | note 126012 added to language.basic-syntax.phpmode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216286@lists.php.net to get a copy of this message | ||
I find the notion that PHP "starts parsing" inside a <?php ... ?> tag, and
"just passes through" everything outside a tag, to be a confusing oversimplification and
generally wrong.
For example, this code would be inexplicable:
<?php for ($i = 0; $i < 10; $i++) { ?>
Repeated<br>
<?php } ?>
I think a better way to look at it is that the PHP parser turns any text NOT inside a <?php ...
?> tag into an implicit echo statement that is embedded at the corresponding place in the code.
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 107.3.165.17)
----
Manual Page -- https://php.net/manual/en/language.basic-syntax.phpmode.php
Edit -- https://main.php.net/note/edit/126012
Del: integrated -- https://main.php.net/note/delete/126012/integrated
Del: useless -- https://main.php.net/note/delete/126012/useless
Del: bad code -- https://main.php.net/note/delete/126012/bad+code
Del: spam -- https://main.php.net/note/delete/126012/spam
Del: non-english -- https://main.php.net/note/delete/126012/non-english
Del: in docs -- https://main.php.net/note/delete/126012/in+docs
Del: other reasons-- https://main.php.net/note/delete/126012
Reject -- https://main.php.net/note/reject/126012
Search -- https://main.php.net/manage/user-notes.php