note 47895 added to language.functions

From: Date: Sat, 04 Dec 2004 06:19:04 +0000
Subject: note 47895 added to language.functions
Groups: php.notes 
Request: Send a blank email to php-notes+get-81355@lists.php.net to get a copy of this message
Inner function (thats declared inside some other outer function) has no access to outer function's variables. function bar() { function bar2() { echo $bar_name; } $bar_name = "Bar Name"; bar2(); } bar(); Now this will not print 'Bar Name'. So inner function (bar2) has no access to outer function's (bar) variable ($bar_name). ---- Manual Page -- http://www.php.net/manual/en/language.functions.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47895 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47895&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47895&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47895&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47895&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47895&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47895&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47895&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81355) next »