PHP 4.0 Bug #10171: calling function before it is defined only works in same file
| From: | aboyd at ssti dot com | Date: | Wed, 04 Apr 2001 23:05:29 +0000 |
| Subject: | PHP 4.0 Bug #10171: calling function before it is defined only works in same file | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-50888@lists.php.net to get a copy of this message | ||
From: aboyd@ssti.com
Operating system: Windows NT 4 sp 5 & Solaris 8
PHP version: 4.0.4pl1
PHP Bug Type: Scripting Engine problem
Bug description: calling function before it is defined only works in same file
Define a function. Put a call to that function BEFORE it is defined. That works, as documented.
Now put the function in an include()'d or require()'d file. Call the function before the
include() or require(). It fails.
Since the code is pre-compiled beforehand, shouldn't the function calls still work? If this is
"as designed" it might be nice to place a caveat in the documentation that states
"you can call a function before you define it ONLY if the function isn't buried in an
include()."
--
Edit Bug report at: http://bugs.php.net/?id=10171&edit=1