<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/language.namespaces.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'language.namespaces.global.php',
    1 => 'Global',
    2 => 'Espace de noms global',
  ),
  'up' => 
  array (
    0 => 'language.namespaces.php',
    1 => 'Les espaces de noms',
  ),
  'prev' => 
  array (
    0 => 'language.namespaces.importing.php',
    1 => 'Importation et alias',
  ),
  'next' => 
  array (
    0 => 'language.namespaces.fallback.php',
    1 => 'Retour sur l\'espace global',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'language/namespaces.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="language.namespaces.global" class="sect1">
  <h2 class="title">Espace de noms global</h2>
  
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8)</p>
  <p class="para">
   Sans aucune définition d&#039;espace de noms, toutes les classes et les fonctions
   sont placées dans le namespace global : comme en PHP avant que les espaces
   de noms aient été introduits. En préfixant un nom avec un antislash
   <code class="literal">\</code>, on peut demander l&#039;utilisation du namespace
   global, même dans un contexte d&#039;espace de noms spécifique.
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Spécification d&#039;espace de noms global</strong></p>
    <div class="example-contents">
     <div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">namespace </span><span style="color: #0000BB">A\B\C</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">/* Cette fonction est A\B\C\fopen */<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">fopen</span><span style="color: #007700">() {<br />     </span><span style="color: #FF8000">/* ... */<br />     </span><span style="color: #0000BB">$f </span><span style="color: #007700">= </span><span style="color: #0000BB">\fopen</span><span style="color: #007700">(...); </span><span style="color: #FF8000">// appel à fopen global<br />     </span><span style="color: #007700">return </span><span style="color: #0000BB">$f</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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