From 0d42c03a84ce847a63e186d03857d67a271aa5ab Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 6 Jun 2005 15:26:20 +0000 Subject: [PATCH] Scope of functions inside functions (bug #33239) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@187768 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/control-structures.xml | 4 +++- language/functions.xml | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/language/control-structures.xml b/language/control-structures.xml index 14039050a6..948fa65ebc 100644 --- a/language/control-structures.xml +++ b/language/control-structures.xml @@ -1,5 +1,5 @@ - + Control Structures @@ -1305,6 +1305,8 @@ require ('somefile.txt'); line on which the include occurs. Any variables available at that line in the calling file will be available within the called file, from that point forward. + However, all functions and classes defined in the included file have the + global scope. diff --git a/language/functions.xml b/language/functions.xml index 6d658228fb..9e1cf5bcd3 100644 --- a/language/functions.xml +++ b/language/functions.xml @@ -1,5 +1,5 @@ - + Functions @@ -109,6 +109,10 @@ bar(); + + All functions and classes in PHP have the global scope - they can be + called outside a function even if they were defined inside and vice versa. + PHP does not support function overloading, nor is it possible to undefine or redefine previously-declared functions.