ID: 33239
Updated by: [EMAIL PROTECTED]
Reported By: pythonboy at gmail dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: any
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
"All functions and classes defined in the included file have the global
scope."
Previous Comments:
------------------------------------------------------------------------
[2005-06-03 22:08:34] pythonboy at gmail dot com
Description:
------------
When a file contains function/class definition and this file is
included inside another function/method the definition has global scope
Reproduce code:
---------------
Example
function wilma()
{
//fred.php contains fred() function definition
include('fred.php') ;
}
wilma() ;
//prints "yabba-yabba-doo"
echo fred() ;
Expected result:
----------------
As to the manual...
http://www.php.net/manual/en/function.include.php
Fatal error: Call to undefined function: fred()
Actual result:
--------------
fred() is defined in global scope
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33239&edit=1