mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Scope of functions inside functions (bug #33239)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@187768 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
46d099ad81
commit
0d42c03a84
2 changed files with 8 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.118 $ -->
|
||||
<!-- $Revision: 1.119 $ -->
|
||||
<chapter id="language.control-structures">
|
||||
<title>Control Structures</title>
|
||||
|
||||
|
@ -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.
|
||||
</simpara>
|
||||
<para>
|
||||
<example>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.58 $ -->
|
||||
<!-- $Revision: 1.59 $ -->
|
||||
<chapter id="language.functions">
|
||||
<title>Functions</title>
|
||||
|
||||
|
@ -109,6 +109,10 @@ bar();
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
<simpara>
|
||||
PHP does not support function overloading, nor is it possible to
|
||||
undefine or redefine previously-declared functions.
|
||||
|
|
Loading…
Reference in a new issue