<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.exception.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'exception.getcode.php',
    1 => 'Exception::getCode',
    2 => 'Gets the Exception code',
  ),
  'up' => 
  array (
    0 => 'class.exception.php',
    1 => 'Exception',
  ),
  'prev' => 
  array (
    0 => 'exception.getprevious.php',
    1 => 'Exception::getPrevious',
  ),
  'next' => 
  array (
    0 => 'exception.getfile.php',
    1 => 'Exception::getFile',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'language/predefined/exception/getcode.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="exception.getcode" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Exception::getCode</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">Exception::getCode</span> &mdash; <span class="dc-title">Gets the Exception code</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-exception.getcode-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><strong>Exception::getCode</strong></span>(): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   Returns the Exception code.
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-exception.getcode-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">Questa funzione non contiene parametri.</p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-exception.getcode-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Returns the exception code as <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> in
   <span class="classname"><a href="class.exception.php" class="classname">Exception</a></span> but possibly as other type in
   <span class="classname"><a href="class.exception.php" class="classname">Exception</a></span> descendants (for example as
   <span class="type"><a href="language.types.string.php" class="type string">string</a></span> in <span class="classname"><a href="class.pdoexception.php" class="classname">PDOException</a></span>).
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-exception.getcode-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="function"><strong>Exception::getCode()</strong></span> example</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">try {<br />    throw new </span><span style="color: #0000BB">Exception</span><span style="color: #007700">(</span><span style="color: #DD0000">"Some error message"</span><span style="color: #007700">, </span><span style="color: #0000BB">30</span><span style="color: #007700">);<br />} catch(</span><span style="color: #0000BB">Exception $e</span><span style="color: #007700">) {<br />    echo </span><span style="color: #DD0000">"The exception code is: " </span><span style="color: #007700">. </span><span style="color: #0000BB">$e</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getCode</span><span style="color: #007700">();<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Il precedente esempio visualizzerà
qualcosa simile a:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">The exception code is: 30</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-exception.getcode-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="throwable.getcode.php" class="methodname" rel="rdfs-seeAlso">Throwable::getCode()</a> - Gets the exception code</span></li>
   </ul>
  </p>
 </div>

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