note 15492 added to functions
| From: | alvarez at st-oneline dot net | Date: | Thu, 13 Sep 2001 18:20:57 +0000 |
| Subject: | note 15492 added to functions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17988@lists.php.net to get a copy of this message | ||
Although the PHP4 documentation explicitly
says function calls do not need to be placed
after the respective function declaration, this
is not true when functions are declared within
each other. Consider the following declaration:
function container () {
fred ();
function fred () {
echo 'Hello, world';
}
}
container ();
As with version 4.03 of PHP, the PHP3 behaviour
remains for this special case and the program
aborts with an 'undefined function error'. I
consider this an arbitrary limitation, which should
be documented, or at best changed.
Daniel Alvarez
http://www.php.net/manual/en/functions.php