<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.reflectionmethod.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'reflectionmethod.createfrommethodname.php',
    1 => 'ReflectionMethod::createFromMethodName',
    2 => 'Cr&eacute;er une nouvelle ReflectionMethod',
  ),
  'up' => 
  array (
    0 => 'class.reflectionmethod.php',
    1 => 'ReflectionMethod',
  ),
  'prev' => 
  array (
    0 => 'reflectionmethod.construct.php',
    1 => 'ReflectionMethod::__construct',
  ),
  'next' => 
  array (
    0 => 'reflectionmethod.export.php',
    1 => 'ReflectionMethod::export',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/reflection/reflectionmethod/createfrommethodname.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="reflectionmethod.createfrommethodname" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ReflectionMethod::createFromMethodName</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.3.0)</p><p class="refpurpose"><span class="refname">ReflectionMethod::createFromMethodName</span> &mdash; <span class="dc-title">Créer une nouvelle ReflectionMethod</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-reflectionmethod.createfrommethodname-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>ReflectionMethod::createFromMethodName</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$method</code></span>): <span class="type">static</span></div>

  <p class="para rdfs-comment">
   Crée une nouvelle <span class="classname"><a href="class.reflectionmethod.php" class="classname">ReflectionMethod</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-reflectionmethod.createfrommethodname-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">method</code></dt>
     <dd>
      <p class="para">
       Nom de la classe et de la méthode délimités par <code class="literal">::</code>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-reflectionmethod.createfrommethodname-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne une nouvelle <span class="classname"><a href="class.reflectionmethod.php" class="classname">ReflectionMethod</a></span> en cas de succès.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-reflectionmethod.createfrommethodname-errors">
  <h3 class="title">Erreurs / Exceptions</h3>
  <p class="para">
   Une <span class="classname"><a href="class.reflectionexception.php" class="classname">ReflectionException</a></span> est lancée si la méthode donnée n&#039;existe pas.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-reflectionmethod.createfrommethodname-examples">
  <h3 class="title">Exemples</h3>
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="methodname"><strong>ReflectionMethod::createFromMethodName()</strong></span></strong></p>
    <div class="example-contents">
<div class="annotation-interactive 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">Foo </span><span style="color: #007700">{<br />    public function </span><span style="color: #0000BB">bar</span><span style="color: #007700">() {<br /><br />    }<br />}<br /><br /></span><span style="color: #0000BB">$methodInfo </span><span style="color: #007700">= </span><span style="color: #0000BB">ReflectionMethod</span><span style="color: #007700">::</span><span style="color: #0000BB">createFromMethodName</span><span style="color: #007700">(</span><span style="color: #DD0000">"Foo::bar"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$methodInfo</span><span style="color: #007700">);<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="annotation-interactive examplescode"><pre class="examplescode">object(ReflectionMethod)#1 (2) {
  [&quot;name&quot;]=&gt;
  string(3) &quot;bar&quot;
  [&quot;class&quot;]=&gt;
  string(3) &quot;Foo&quot;
}</pre>
</div>
    </div>
   </div>
 </div>

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