mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
Added a warning about the register_globals change; added $GLOBALS.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@73028 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
8c46867068
commit
2a8588bf1b
1 changed files with 34 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.38 $ -->
|
||||
<!-- $Revision: 1.39 $ -->
|
||||
<chapter id="language.variables">
|
||||
<title>Variables</title>
|
||||
|
||||
|
@ -121,6 +121,28 @@ $bar = &test(); // Invalid.
|
|||
<link linkend="reserved.variables">Predefined variables</link>.
|
||||
</simpara>
|
||||
|
||||
<warning>
|
||||
<simpara>
|
||||
In PHP 4.1.0 and later, the default set of predefined variables
|
||||
which are available in the global scope has changed. Individual
|
||||
input and server variables are <emphasis>by default</emphasis>no
|
||||
longer placed directly into the global scope; rather, they are
|
||||
placed into the following <link
|
||||
linkend="language.variables.superglobals">superglobal
|
||||
arrays</link>.
|
||||
</simpara>
|
||||
<simpara>
|
||||
You can still force the old behaviour by setting <link
|
||||
linkend="ini.register-globals">register_globals</link> to 'On' in
|
||||
your <filename>php.ini</filename> file.
|
||||
</simpara>
|
||||
<simpara>
|
||||
For more information and background on this change, please see
|
||||
the <ulink url="&url.php.release4.1.0;">PHP 4.1.0 Release
|
||||
Announcement</ulink>.
|
||||
</simpara>
|
||||
</warning>
|
||||
|
||||
<simpara>
|
||||
From version 4.1.0 onward, PHP provides a set of predefined arrays
|
||||
containing variables from the web server (if applicable), the
|
||||
|
@ -134,8 +156,18 @@ $bar = &test(); // Invalid.
|
|||
<link linkend="reserved.variables">Predefined variables</link>.
|
||||
</simpara>
|
||||
|
||||
<variablelist>
|
||||
<variablelist id="language.variables.superglobals">
|
||||
<title>PHP Superglobals</title>
|
||||
<varlistentry>
|
||||
<term><link linkend="reserved.variables.globals">$GLOBALS</link></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Contains a reference to every variable which is currently
|
||||
available within the global scope of the script. The keys of
|
||||
this array are the names of the global variables.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><link linkend="reserved.variables.server">$_SERVER</link></term>
|
||||
<listitem>
|
||||
|
|
Loading…
Reference in a new issue