note 33833 added to function.include

From: Date: Wed, 09 Jul 2003 00:01:03 +0000
Subject: note 33833 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-51738@lists.php.net to get a copy of this message
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 ---- Manual Page -- http://www.php.net/manual/en/function.include.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33833 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33833&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33833&report=yes

« previous php.notes (#51738) next »