Implement register_long_arrays information, available as of PHP 5.0.0

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@130337 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2003-06-06 05:33:09 +00:00
parent d138895a4a
commit 26e0e96ebf
5 changed files with 53 additions and 5 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.32 $ -->
<!-- $Revision: 1.33 $ -->
<appendix id="reserved">
<title>List of Reserved Words</title>
@ -216,6 +216,16 @@
<sect1 id="reserved.variables">
<title>Predefined Variables</title>
<para>
Since PHP 4.1.0, the preferred method for retrieving
<link linkend="language.variables.external">external variables</link> is
with the superglobals mentioned below. Before this time, people relied
on either <link linkend="ini.register-globals">register_globals</link>
or the long predefined PHP arrays (<varname>$HTTP_*_VARS</varname>).
&avail.register-long-arrays;
</para>
<sect2 id="reserved.variables.server">
<title>Server variables: <varname>$_SERVER</varname></title>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.105 $ -->
<!-- $Revision: 1.106 $ -->
<chapter id="configuration">
<title>Configuration</title>
@ -568,6 +568,11 @@ php_admin_value open_basedir none
<entry>"On"</entry>
<entry>PHP_INI_PERDIR|PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>register_long_arrays</entry>
<entry>"On"</entry>
<entry>PHP_INI_PERDIR|PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>post_max_size</entry>
<entry>"8M"</entry>
@ -747,6 +752,28 @@ php_admin_value open_basedir none
</simpara>
</listitem>
</varlistentry>
<varlistentry id="ini.register-long-arrays">
<term>
<parameter>register_long_arrays</parameter>
<type>boolean</type>
</term>
<listitem>
<simpara>
Tells PHP whether or not to register the deprecated long
<varname>$HTTP_*_VARS</varname> type
<link linkend="language.variables.predefined">predefined
variables</link>. When On (default), long predefined PHP
variables like <varname>$HTTP_GET_VARS</varname> will be defined.
If you're not using them, it's recommended to turn them off,
for performance reasons. Instead, use the superglobal arrays,
like <varname>$_GET</varname>.
</simpara>
<simpara>
This directive became available in PHP 5.0.0.
</simpara>
</listitem>
</varlistentry>
<varlistentry id="ini.post-max-size">
<term>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.20 $ -->
<!-- $Revision: 1.21 $ -->
<chapter id="tutorial">
<title>A simple tutorial</title>
@ -452,6 +452,8 @@ You are 22 years old.
<varname>$_REQUEST</varname>, and <varname>$_SESSION</varname>. The
older <varname>$HTTP_*_VARS</varname> arrays, such as
<varname>$HTTP_POST_VARS</varname>, still exist and have since PHP 3.
&avail.register-long-arrays;
</simpara>
</listitem>
<listitem>

View file

@ -77,6 +77,12 @@ directive but instead use other means, such as the &link.superglobals;.
etc. have been available. For more information, read the manual section
on &link.superglobals;</para></note>'>
<!ENTITY avail.register-long-arrays 'As of PHP 5.0.0, the long PHP
<link linkend="language.variables.predefined">predefined variable</link>
arrays may be disabled with the
<link linkend="ini.register-long-arrays">register_long_arrays</link>
directive.'>
<!ENTITY note.magicquotes.gpc '<note><title>directive note: magic_quotes_gpc
</title><para>The PHP directive <link linkend="ini.magic-quotes-gpc">
magic_quotes_gpc</link> defaults to <literal>on</literal>. It essentially

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.58 $ -->
<!-- $Revision: 1.59 $ -->
<chapter id="language.variables">
<title>Variables</title>
@ -167,6 +167,8 @@ $bar = &test(); // Invalid.
<link linkend="reserved.variables">Reserved Predefined Variables</link>.
Also, you'll notice how the older predefined variables
(<varname>$HTTP_*_VARS</varname>) still exist.
&avail.register-long-arrays;
</simpara>
<note>
@ -780,7 +782,8 @@ echo "$a $hello";
import_request_variables('p', 'p_');
print $p_username;
// Available since PHP 3.
// Available since PHP 3. As of PHP 5.0.0, these long predefined
// variables can be disabled with the register_long_arrays directive.
print $HTTP_POST_VARS['username'];