<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.funchand.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.forward-static-call-array.php',
    1 => 'forward_static_call_array',
    2 => 'Appelle une m&eacute;thode statique et passe les arguments en tableau',
  ),
  'up' => 
  array (
    0 => 'ref.funchand.php',
    1 => 'Fonctions sur la gestion des fonctions',
  ),
  'prev' => 
  array (
    0 => 'function.forward-static-call.php',
    1 => 'forward_static_call',
  ),
  'next' => 
  array (
    0 => 'function.func-get-arg.php',
    1 => 'func_get_arg',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/funchand/functions/forward-static-call-array.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.forward-static-call-array" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">forward_static_call_array</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">forward_static_call_array</span> &mdash; <span class="dc-title">Appelle une méthode statique et passe les arguments en tableau</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.forward-static-call-array-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>forward_static_call_array</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$callback</code></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$args</code></span>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>

  <p class="para rdfs-comment">
   Appelle une fonction ou une méthode utilisateur, nommée <code class="parameter">callback</code>,
   avec les arguments rassemblés dans un tableau. Cette fonction doit être appelée depuis
   une méthode, et ne peut pas être utilisée hors d&#039;une classe.
   Elle utilise le <a href="language.oop5.late-static-bindings.php" class="link">liage statique</a>.
   Tous les arguments transmis sont passés par valeur dans un tableau, similairement à 
   <span class="function"><a href="function.call-user-func-array.php" class="function">call_user_func_array()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.forward-static-call-array-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">callback</code></dt>
     <dd>
      <p class="para">
       La fonction ou la méthode appelée. Ce paramètre peut être un tableau,
       avec le nom de la classe et de la méthode, ou une chaîne, avec le nom
       de la fonction.
      </p>
     </dd>
    
    
     <dt><code class="parameter">args</code></dt>
     <dd>
      <p class="para">
       Un paramètre, rassemblant tous les paramètres dans un tableau.
      </p>
      <blockquote class="note"><p><strong class="note">Note</strong>: 
       <p class="para">
        Il est à noter que les paramètres de <span class="function"><strong>forward_static_call_array()</strong></span> ne sont
        pas passés par référence.
       </p>
      </p></blockquote>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.forward-static-call-array-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne le résultat de la fonction, et <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> en cas d&#039;erreur.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.forward-static-call-array-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>forward_static_call_array()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">class </span><span style="color: #0000BB">A<br /></span><span style="color: #007700">{<br />    const </span><span style="color: #0000BB">NAME </span><span style="color: #007700">= </span><span style="color: #DD0000">'A'</span><span style="color: #007700">;<br />    public static function </span><span style="color: #0000BB">test</span><span style="color: #007700">() {<br />        </span><span style="color: #0000BB">$args </span><span style="color: #007700">= </span><span style="color: #0000BB">func_get_args</span><span style="color: #007700">();<br />        echo static::</span><span style="color: #0000BB">NAME</span><span style="color: #007700">, </span><span style="color: #DD0000">" "</span><span style="color: #007700">.</span><span style="color: #0000BB">join</span><span style="color: #007700">(</span><span style="color: #DD0000">','</span><span style="color: #007700">, </span><span style="color: #0000BB">$args</span><span style="color: #007700">).</span><span style="color: #DD0000">" \n"</span><span style="color: #007700">;<br />    }<br />}<br /><br />class </span><span style="color: #0000BB">B </span><span style="color: #007700">extends </span><span style="color: #0000BB">A<br /></span><span style="color: #007700">{<br />    const </span><span style="color: #0000BB">NAME </span><span style="color: #007700">= </span><span style="color: #DD0000">'B'</span><span style="color: #007700">;<br /><br />    public static function </span><span style="color: #0000BB">test</span><span style="color: #007700">() {<br />        echo </span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">NAME</span><span style="color: #007700">, </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />        </span><span style="color: #0000BB">forward_static_call_array</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'A'</span><span style="color: #007700">, </span><span style="color: #DD0000">'test'</span><span style="color: #007700">), array(</span><span style="color: #DD0000">'encore'</span><span style="color: #007700">, </span><span style="color: #DD0000">'args'</span><span style="color: #007700">));<br />        </span><span style="color: #0000BB">forward_static_call_array</span><span style="color: #007700">( </span><span style="color: #DD0000">'test'</span><span style="color: #007700">, array(</span><span style="color: #DD0000">'autres'</span><span style="color: #007700">, </span><span style="color: #DD0000">'args'</span><span style="color: #007700">));<br />    }<br />}<br /><br /></span><span style="color: #0000BB">B</span><span style="color: #007700">::</span><span style="color: #0000BB">test</span><span style="color: #007700">(</span><span style="color: #DD0000">'foo'</span><span style="color: #007700">);<br /><br />function </span><span style="color: #0000BB">test</span><span style="color: #007700">() {<br />        </span><span style="color: #0000BB">$args </span><span style="color: #007700">= </span><span style="color: #0000BB">func_get_args</span><span style="color: #007700">();<br />        echo </span><span style="color: #DD0000">"C "</span><span style="color: #007700">.</span><span style="color: #0000BB">join</span><span style="color: #007700">(</span><span style="color: #DD0000">','</span><span style="color: #007700">, </span><span style="color: #0000BB">$args</span><span style="color: #007700">).</span><span style="color: #DD0000">" \n"</span><span style="color: #007700">;<br />    }<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>L&#039;exemple ci-dessus va afficher :</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">B
B encore,args 
C autres,args</pre>
</div>
    </div>
   </div>
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.forward-static-call-array-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.forward-static-call.php" class="function" rel="rdfs-seeAlso">forward_static_call()</a> - Appelle une m&eacute;thode statique</span></li>
    <li><span class="function"><a href="function.call-user-func.php" class="function" rel="rdfs-seeAlso">call_user_func()</a> - Appelle une fonction de rappel fournie par le premier argument</span></li>
    <li><span class="function"><a href="function.call-user-func-array.php" class="function" rel="rdfs-seeAlso">call_user_func_array()</a> - Appelle une fonction de rappel avec les param&egrave;tres rassembl&eacute;s en tableau</span></li>
    <li><span class="function"><a href="function.is-callable.php" class="function" rel="rdfs-seeAlso">is_callable()</a> - D&eacute;termine si une valeur peut &ecirc;tre appel&eacute; comme une fonction
   dans la port&eacute;e courante</span></li>
   </ul>
  </p>
 </div>


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