<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/reserved.variables.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'language.variables.superglobals.php',
    1 => 'Superglobals',
    2 => 'Built-in variables that are always available in all scopes',
  ),
  'up' => 
  array (
    0 => 'reserved.variables.php',
    1 => 'Predefined Variables',
  ),
  'prev' => 
  array (
    0 => 'reserved.variables.php',
    1 => 'Predefined Variables',
  ),
  'next' => 
  array (
    0 => 'reserved.variables.globals.php',
    1 => '$GLOBALS',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'language/predefined/variables/superglobals.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="language.variables.superglobals" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Superglobals</h1>
  <p class="refpurpose"><span class="refname">Superglobals</span> &mdash; <span class="dc-title">Built-in variables that are always available in all scopes</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-language.variables.superglobals-description">
  <h3 class="title">Description</h3>
  <p class="para">
   Several predefined variables in PHP are &quot;superglobals&quot;, which means they
   are available in all scopes throughout a script. There is no need to do
   <strong class="command">global $variable;</strong> to access them within functions
   or methods.
  </p>
  <p class="para">
   These superglobal variables are:
   <ul class="simplelist">
    <li><var class="varname"><a href="reserved.variables.globals.php" class="classname">$GLOBALS</a></var></li>
    <li><var class="varname"><a href="reserved.variables.server.php" class="classname">$_SERVER</a></var></li>
    <li><var class="varname"><a href="reserved.variables.get.php" class="classname">$_GET</a></var></li>
    <li><var class="varname"><a href="reserved.variables.post.php" class="classname">$_POST</a></var></li>
    <li><var class="varname"><a href="reserved.variables.files.php" class="classname">$_FILES</a></var></li>
    <li><var class="varname"><a href="reserved.variables.cookies.php" class="classname">$_COOKIE</a></var></li>
    <li><var class="varname"><a href="reserved.variables.session.php" class="classname">$_SESSION</a></var></li>
    <li><var class="varname"><a href="reserved.variables.request.php" class="classname">$_REQUEST</a></var></li>
    <li><var class="varname"><a href="reserved.variables.environment.php" class="classname">$_ENV</a></var></li>
   </ul>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-language.variables.superglobals-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <strong>Variable availability</strong><br />
   <p class="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
    <a href="ini.core.php#ini.variables-order" class="link">variables_order</a>.
   </p>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <strong>Variable variables</strong><br />
   <p class="para">
    Superglobals cannot be used as 
    <a href="language.variables.variable.php" class="link">variable variables</a>
    inside functions or class methods.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-language.variables.superglobals-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><a href="language.variables.scope.php" class="link">variable scope</a></li>
    <li>The <a href="ini.core.php#ini.variables-order" class="link">variables_order</a> directive</li>
    <li><a href="book.filter.php" class="link">The filter extension</a></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>