note 85112 deleted from function.return by peehaa
| From: | peehaa@php.net | Date: | Sun, 28 Apr 2019 10:27:27 +0000 |
| Subject: | note 85112 deleted from function.return by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210785@lists.php.net to get a copy of this message | ||
Note Submitter: andrew at neonsurge dot com
----
Response to stoic's message below...
I believe the way you've explained this for people may be a bit confusing, and your verbiage is
incorrect. Your script below is technically calling return from a global scope, but as it says
right after that in the description above... "If the current script file was include()ed or
require()ed, then control is passed back to the calling file". You are in a included file.
Just making sure that is clear.
Now, the way php works is before it executes actual code it does what you call
"processing" is really just a syntax check. It does this every time per-file that is
included before executing that file. This is a GOOD feature, as it makes sure not to run any part
of non-functional code. What your example might have also said... is that in doing this syntax
check it does not execute code, merely runs through your file (or include) checking for syntax
errors before execution. To show that, you should put the echo "b"; and echo
"a"; at the start of each file. This will show that "b" is echoed once, and
then "a" is echoed only once, because the first time it syntax checked a.php, it was ok.
But the second time the syntax check failed and thus it was not executed again and terminated
execution of the application due to a syntax error.
Just something to help clarify what you have stated in your comments.