<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.errorfunc.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.trigger-error.php',
    1 => 'trigger_error',
    2 => 'Genera un messaggio a livello utente di errore/avviso/avvertimento message',
  ),
  'up' => 
  array (
    0 => 'ref.errorfunc.php',
    1 => 'Error Handling Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.set-exception-handler.php',
    1 => 'set_exception_handler',
  ),
  'next' => 
  array (
    0 => 'function.user-error.php',
    1 => 'user_error',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/errorfunc/functions/trigger-error.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.trigger-error" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">trigger_error</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.0.1, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">trigger_error</span> &mdash; <span class="dc-title">
     Genera un messaggio a livello utente di errore/avviso/avvertimento message
    </span></p>

   </div>
   <div class="refsect1 unknown-28" id="refsect1-function.trigger-error-unknown-28">
    <h3 class="title">Descrizione</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>trigger_error</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$error_msg</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$error_type</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

    <p class="para rdfs-comment">
     Utilizzata per attivare una condizione di errore utente, può
     essere usata in congiunzione con il gestore di errore interno, o con
     una funzione definita dall&#039;utente che sia configurata per essere il 
     nuovo gestore di errore con (<span class="function"><a href="function.set-error-handler.php" class="function">set_error_handler()</a></span>).
     Funziona soltanto con  la famiglia di costanti E_USER, e punta alla
     predefinita <strong><code><a href="errorfunc.constants.php#constant.e-user-notice">E_USER_NOTICE</a></code></strong>.
    </p>
    <p class="para">
     Questa funzione è utile quando sia necessario generare una particolare
     risposta ad un&#039;eccezione durante l&#039;esecuzione.
     Per esempio:
     <div class="informalexample">
      <div class="example-contents">
<div class="cdata"><pre>
if (assert ($divisor == 0))
   trigger_error (&quot;Cannot divide by zero&quot;, E_USER_ERROR);
</pre></div>
      </div>

     </div>
     <blockquote class="note"><p><strong class="note">Nota</strong>: 
     <p class="para">
     Vedere <span class="function"><a href="function.set-error-handler.php" class="function">set_error_handler()</a></span> per un esempio più esplicativo.
     </p>
     </p></blockquote>
    </p>
    <p class="para">
     Vedere anche <span class="function"><a href="function.error-reporting.php" class="function">error_reporting()</a></span>,
     <span class="function"><a href="function.set-error-handler.php" class="function">set_error_handler()</a></span>,
     <span class="function"><a href="function.restore-error-handler.php" class="function">restore_error_handler()</a></span>, 
     <span class="function"><a href="function.user-error.php" class="function">user_error()</a></span>
    </p>
   </div>

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