Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 2320

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Construct the exception</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.exception.html">Exception</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="exception.getmessage.html">Exception::getMessage</a></div>
 <div class="up"><a href="class.exception.html">Exception</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="exception.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Exception::__construct</h1>
  <p class="verinfo">(PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">Exception::__construct</span> &mdash; <span class="dc-title">Construct the exception</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-exception.construct-description">
  <h3 class="title">Description</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Exception::__construct</strong></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$message</code><span class="initializer"> = &quot;&quot;</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$code</code><span class="initializer"> = 0</span></span>
   [, <span class="methodparam"><span class="type"><a href="class.throwable.html" class="type Throwable">Throwable</a></span> <code class="parameter">$previous</code><span class="initializer"> = <strong><code>NULL</code></strong></span></span>
  ]]] )</div>

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

 
 <div class="refsect1 parameters" id="refsect1-exception.construct-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">message</code></dt>

     <dd>

      <p class="para">
       The Exception message to throw.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">code</code></dt>

     <dd>

      <p class="para">
       The Exception code.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">previous</code></dt>

     <dd>

      <p class="para">
       The previous exception used for the exception chaining.
      </p>
     </dd>

    
   </dl>

  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <span class="simpara">
    Calling the constructor of class Exception from a subclass ignores the
    default arguments, if the properties $code and $message are already set.
   </span>
  </p></blockquote>
 </div>

 
 <div class="refsect1 changelog" id="refsect1-exception.construct-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>7.0.0</td>
       <td>
        The <code class="parameter">previous</code> parameter is now of type <span class="type"><a href="class.throwable.html" class="type Throwable">Throwable</a></span>.
       </td>
      </tr>

      <tr>
       <td>5.3.0</td>
       <td>
        The <code class="parameter">previous</code> parameter was added.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 
 <div class="refsect1 notes" id="refsect1-exception.construct-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    The <code class="parameter">message</code> is <em class="emphasis">NOT</em> 
    binary safe.
   </p>
  </p></blockquote>
 </div>

 
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.exception.html">Exception</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="exception.getmessage.html">Exception::getMessage</a></div>
 <div class="up"><a href="class.exception.html">Exception</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>