note 83663 deleted from function.return by googleguy
| From: | googleguy@php.net | Date: | Thu, 02 Jan 2014 23:16:27 +0000 |
| Subject: | note 83663 deleted from function.return by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-198088@lists.php.net to get a copy of this message | ||
Note Submitter: stoic
----
Just to clear things up, if using return on a global scope it will end EXECUTION but NOT PROCESSING.
for example:
file a.php
<?php
if(defined("A")) return;
define("A", true);
echo "Hello";
?>
file b.php
<?php
include("a.php");
include("a.php");
?>
will output "Hello" only once.
but if file a.php is
<?php
if(defined("A")) return;
define("A", true);
function foo(){
}
?>
running file b.php will produce error:
Fatal Error: Cannot redeclare foo()...