<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.classobj.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.method-exists.php',
    1 => 'method_exists',
    2 => 'Verifica se il metodo della classe esiste',
  ),
  'up' => 
  array (
    0 => 'ref.classobj.php',
    1 => 'Classes/Object Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.is-subclass-of.php',
    1 => 'is_subclass_of',
  ),
  'next' => 
  array (
    0 => 'function.property-exists.php',
    1 => 'property_exists',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/classobj/functions/method-exists.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.method-exists" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">method_exists</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">method_exists</span> &mdash; <span class="dc-title">Verifica se il metodo della classe esiste</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.method-exists-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>method_exists</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$object</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$method_name</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Verifica se il metodo della classe esiste nell&#039;<code class="parameter">object</code>
   dato.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.method-exists-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">object</code></dt>
     <dd>
      <p class="para">
       Un&#039;istanza dell&#039;oggetto o un nome della classe
      </p>
     </dd>
    
    
     <dt><code class="parameter">method_name</code></dt>
     <dd>
      <p class="para">
       Il nome del metodo
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.method-exists-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Restituisce <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> se il metodo dato da <code class="parameter">method_name</code>
   è definito per il dato <code class="parameter">object</code>, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> 
   in caso contrario.
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.method-exists-notes">
  <h3 class="title">Note</h3>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
<p class="para">L&#039;utilizzo di questa funzione attiverà tutti gli
<a href="language.oop5.autoload.php" class="link">autoloaders</a> se la classe non è già conosciuta.</p></p></blockquote>
 </div>


 <div class="refsect1 examples" id="refsect1-function.method-exists-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 Esempio di <span class="function"><strong>method_exists()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$directory </span><span style="color: #007700">= new </span><span style="color: #0000BB">Directory</span><span style="color: #007700">(</span><span style="color: #DD0000">'.'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">method_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">$directory</span><span style="color: #007700">,</span><span style="color: #DD0000">'read'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Il precedente esempio visualizzerà:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">bool(true)</pre>
</div>
    </div>
   </div>
   <div class="example" id="example-2">
    <p><strong>Example #2 Esempio di <span class="function"><strong>method_exists()</strong></span> statico</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">method_exists</span><span style="color: #007700">(</span><span style="color: #DD0000">'Directory'</span><span style="color: #007700">,</span><span style="color: #DD0000">'read'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Il precedente esempio visualizzerà:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">bool(true)</pre>
</div>
    </div>
   </div>
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.method-exists-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.function-exists.php" class="function" rel="rdfs-seeAlso">function_exists()</a> - Return true if the given function has been defined</span></li>
    <li><span class="function"><a href="function.is-callable.php" class="function" rel="rdfs-seeAlso">is_callable()</a> - Verifica se il contenuto di una variabile pu&ograve; essere eseguito come una funzione</span></li>
    <li><span class="function"><a href="function.class-exists.php" class="function" rel="rdfs-seeAlso">class_exists()</a> - Verifica se la classe &egrave; stata definita</span></li>
   </ul>
  </p>
 </div>

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