<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.datetimeimmutable.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'datetimeimmutable.getlasterrors.php',
    1 => 'DateTimeImmutable::getLastErrors',
    2 => 'Liefert die Warnungen und Fehler',
  ),
  'up' => 
  array (
    0 => 'class.datetimeimmutable.php',
    1 => 'DateTimeImmutable',
  ),
  'prev' => 
  array (
    0 => 'datetimeimmutable.createfrommutable.php',
    1 => 'DateTimeImmutable::createFromMutable',
  ),
  'next' => 
  array (
    0 => 'datetimeimmutable.modify.php',
    1 => 'DateTimeImmutable::modify',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/datetime/datetimeimmutable/getlasterrors.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="datetimeimmutable.getlasterrors" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DateTimeImmutable::getLastErrors</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">DateTimeImmutable::getLastErrors</span> &mdash; <span class="dc-title">Liefert die Warnungen und Fehler</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-datetimeimmutable.getlasterrors-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>DateTimeImmutable::getLastErrors</strong></span>(): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Gibt ein Array von Warnungen und Fehlern zurück, die beim Parsen einer
   Datum/Zeit-Zeichenkette gefunden wurden.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-datetimeimmutable.getlasterrors-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">Diese Funktion besitzt keine Parameter.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-datetimeimmutable.getlasterrors-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt ein Array zurück, das Informationen über Warnungen und Fehler enthält,
   oder <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, wenn es weder Warnungen noch Fehler gibt.
  </p>
 </div>


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

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.2.0</td>
       <td>
        Vor PHP 8.2.0 gab diese Funktion nicht <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurück, wenn es keine
        Warnungen oder Fehler gab. Stattdessen gab sie immer die dokumentierte
        Array-Struktur zurück.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-datetimeimmutable.getlasterrors-examples">
  <h3 class="title">Beispiele</h3>
  <div class="example" id="example-1">
   <p><strong>Beispiel #1 <span class="function"><strong>DateTimeImmutable::getLastErrors()</strong></span>-Beispiel</strong></p>
   <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">try {<br />    </span><span style="color: #0000BB">$date </span><span style="color: #007700">= new </span><span style="color: #0000BB">DateTimeImmutable</span><span style="color: #007700">(</span><span style="color: #DD0000">'asdfasdf'</span><span style="color: #007700">);<br />} catch (</span><span style="color: #0000BB">Exception $e</span><span style="color: #007700">) {<br />    </span><span style="color: #FF8000">// Nur zur Veranschaulichung...<br />    </span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">DateTimeImmutable</span><span style="color: #007700">::</span><span style="color: #0000BB">getLastErrors</span><span style="color: #007700">());<br /><br />    </span><span style="color: #FF8000">// Wirklich objektorientiert geht dies folgendermaßen<br />    // echo $e-&gt;getMessage();<br /></span><span style="color: #007700">}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Die obigen Bespiele erzeugen folgende Ausgabe:</p></div>
   <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">Array
(
   [warning_count] =&gt; 1
   [warnings] =&gt; Array
       (
           [6] =&gt; Double timezone specification
       )

   [error_count] =&gt; 1
   [errors] =&gt; Array
       (
           [0] =&gt; The timezone could not be found in the database
       )

)</pre>
</div>
   </div>
   <div class="example-contents"><p>
    Die Indizes 6 und 0 in der Beispielausgabe beziehen sich auf den
    Zeichenindex in der Zeichenkette, in der der Fehler aufgetreten ist.
   </p></div>
  </div>
 </div>


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