mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-31 08:18:56 +00:00

still using this, after discussion on the phpdoc list. From now on, manual.ced will need to be found at ~/.phpdoc/manual.ced. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@288721 c90b9560-bf6c-de11-be94-00142212c4b1
125 lines
3.6 KiB
XML
125 lines
3.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="language.variables.superglobals" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
|
<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><varname>$GLOBALS</varname></member>
|
|
<member><varname>$_SERVER</varname></member>
|
|
<member><varname>$_GET</varname></member>
|
|
<member><varname>$_POST</varname></member>
|
|
<member><varname>$_FILES</varname></member>
|
|
<member><varname>$_COOKIE</varname></member>
|
|
<member><varname>$_SESSION</varname></member>
|
|
<member><varname>$_REQUEST</varname></member>
|
|
<member><varname>$_ENV</varname></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>
|
|
|
|
</phpdoc:varentry>
|
|
|
|
<!-- 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:"~/.phpdoc/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
|
|
-->
|
|
|