<?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 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.error-get-last.php',
    1 => 'error_get_last',
    2 => '最後に発生したエラーを取得する',
  ),
  'up' => 
  array (
    0 => 'ref.errorfunc.php',
    1 => 'エラー処理関数',
  ),
  'prev' => 
  array (
    0 => 'function.error-clear-last.php',
    1 => 'error_clear_last',
  ),
  'next' => 
  array (
    0 => 'function.error-log.php',
    1 => 'error_log',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/errorfunc/functions/error-get-last.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.error-get-last" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">error_get_last</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">error_get_last</span> &mdash; <span class="dc-title">最後に発生したエラーを取得する</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.error-get-last-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>error_get_last</strong></span>(): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.array.php" class="type array">array</a></span></span></div>

  <p class="para rdfs-comment">
   最後に発生したエラーについての情報を取得します。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.error-get-last-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">この関数にはパラメータはありません。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.error-get-last-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   最後に発生したエラーについての情報を連想配列で返します。連想配列のキーは
   &quot;type&quot;、&quot;message&quot;、&quot;file&quot; および &quot;line&quot; となります。
   PHP の内部関数で発生したエラーの場合は、
   &quot;message&quot; の先頭に関数名が含まれています。
   エラーが発生していない場合は <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> を返します。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.error-get-last-examples">
  <h3 class="title">例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>例1 <span class="function"><strong>error_get_last()</strong></span> の例</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">echo </span><span style="color: #0000BB">$a</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">error_get_last</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>上の例の出力は、
たとえば以下のようになります。</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Array
(
    [type] =&gt; 8
    [message] =&gt; Undefined variable: a
    [file] =&gt; C:\WWW\index.php
    [line] =&gt; 2
)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.error-get-last-seealso">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><a href="errorfunc.constants.php" class="link">エラー定数</a></li>
    <li>変数 <var class="varname"><a href="reserved.variables.phperrormsg.php" class="classname">$php_errormsg</a></var></li>
    <li><span class="function"><a href="function.error-clear-last.php" class="function" rel="rdfs-seeAlso">error_clear_last()</a> - 最も最近のエラーをクリア</span></li>
    <li><a href="errorfunc.configuration.php#ini.display-errors" class="link">ディレクティブ <code class="parameter">display_errors</code></a></li>
    <li><a href="errorfunc.configuration.php#ini.html-errors" class="link">ディレクティブ <code class="parameter">html_errors</code></a></li>
    <li><a href="errorfunc.configuration.php#ini.xmlrpc-errors" class="link">ディレクティブ <code class="parameter">xmlrpc_errors</code></a></li>
   </ul>
  </p>
 </div>


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