note 33833 deleted from function.include by vincent
| From: | vincent@php.net | Date: | Sat, 23 Aug 2003 14:40:18 +0000 |
| Subject: | note 33833 deleted from function.include by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54952@lists.php.net to get a copy of this message | ||
Note Submitter: ppo@beeznest.net
----
Even if an included file return a value using return(), it's still sharing the same scope as
the caller script!
<?php
$foo = 'aaa';
$bar = include('include.php');
echo($foo.' / '.$bar);
?>
where include.php is
<?php
$foo = 'bbb';
return $foo;
?>
The output is: bbb / bbb
Not: aaa / bbb