mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Created new superglobals page.
Also, superglobal content from ../variables.xml was folded into this page. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@257945 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
bb8cf940c5
commit
c191d2de89
1 changed files with 125 additions and 0 deletions
125
language/predefined/variables/superglobals.xml
Normal file
125
language/predefined/variables/superglobals.xml
Normal file
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="language.variables.superglobals" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Superglobals</refname>
|
||||
<refpurpose>Superglobals are built-in variables that are always available in all scopes</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<para>
|
||||
Several predefined variables in PHP are "superglobals", which means they
|
||||
are available in all scopes throughout a script. There is no need to do
|
||||
<command>global $variable;</command> to access them within functions
|
||||
or methods.
|
||||
</para>
|
||||
<para>
|
||||
These superglobal variables are:
|
||||
<simplelist>
|
||||
<member><link linkend="reserved.variables.globals">$GLOBALS</link></member>
|
||||
<member><link linkend="reserved.variables.server">$_SERVER</link></member>
|
||||
<member><link linkend="reserved.variables.get">$_GET</link></member>
|
||||
<member><link linkend="reserved.variables.post">$_POST</link></member>
|
||||
<member><link linkend="reserved.variables.files">$_FILES</link></member>
|
||||
<member><link linkend="reserved.variables.cookies">$_COOKIE</link></member>
|
||||
<member><link linkend="reserved.variables.session">$_SESSION</link></member>
|
||||
<member><link linkend="reserved.variables.request">$_REQUEST</link></member>
|
||||
<member><link linkend="reserved.variables.environment">$_ENV</link></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<para>
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>4.1.0</entry>
|
||||
<entry>
|
||||
Superglobals were introduced to PHP.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
<note>
|
||||
<title>Variable availability</title>
|
||||
<para>
|
||||
By default, all of the superglobals are available but there are
|
||||
directives that affect this availability. For further information, refer
|
||||
to the documentation for
|
||||
<link linkend="ini.variables-order">variables_order</link>.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<title>Dealing with register_globals</title>
|
||||
<para>
|
||||
If the deprecated <link linkend="ini.register-globals">register_globals</link>
|
||||
directive is set to <literal>on</literal> then the variables within will
|
||||
also be made available in the global scope of the script. For example,
|
||||
<varname>$_POST['foo']</varname> would also exist as <varname>$foo</varname>.
|
||||
</para>
|
||||
<para>
|
||||
For related information, see the FAQ titled
|
||||
"<link linkend="faq.register-globals">How does register_globals affect me?</link>"
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<title>Variable variables</title>
|
||||
<para>
|
||||
Superglobals cannot be used as
|
||||
<link linkend="language.variables.variable">variable variables</link>
|
||||
inside functions or class methods.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><link linkend="language.variables.scope">variable scope</link></member>
|
||||
<member>The <link linkend="ini.variables-order">variables_order</link> directive</member>
|
||||
<member><link linkend="book.filter">The filter extension</link></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
Loading…
Reference in a new issue