|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-06-06 17:25 UTC] vrana@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Feb 26 19:00:01 2026 UTC |
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