note 110568 added to functions.user-defined
| From: | anonymous | Date: | Thu, 08 Nov 2012 00:01:05 +0000 |
| Subject: | note 110568 added to functions.user-defined | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191799@lists.php.net to get a copy of this message | ||
Functions seem to be declared in memory before runtime. Therefore in the previous example, B() does
exist when you call it, but the second echo will not parse due to the "return" construct
placed outside of the function and in the global scope.
If you want the second "echo" to appear, simply remove the return. The entire script stops
on the "return" being placed in the global scope, similarly to using an "exit()"
call.
----
Server IP: 69.147.83.199
Probable Submitter: 72.21.198.66
----
Manual Page -- http://www.php.net/manual/en/functions.user-defined.php
Edit -- https://master.php.net/note/edit/110568
Del: integrated -- https://master.php.net/note/delete/110568/integrated
Del: useless -- https://master.php.net/note/delete/110568/useless
Del: bad code -- https://master.php.net/note/delete/110568/bad+code
Del: spam -- https://master.php.net/note/delete/110568/spam
Del: non-english -- https://master.php.net/note/delete/110568/non-english
Del: in docs -- https://master.php.net/note/delete/110568/in+docs
Del: other reasons-- https://master.php.net/note/delete/110568
Reject -- https://master.php.net/note/reject/110568
Search -- https://master.php.net/manage/user-notes.php