mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
82 lines
3.8 KiB
HTML
82 lines
3.8 KiB
HTML
<!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>获取最后发生的错误</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.error-get-last" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">error_get_last</h1>
|
|
<p class="verinfo">(PHP 5 >= 5.2.0, PHP 7)</p><p class="refpurpose"><span class="refname">error_get_last</span> — <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="methodparam">void</span>
|
|
) : <span class="type">array</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
获取关于最后一个发生的错误的信息。
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.error-get-last-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
返回了一个关联数组,描述了最后错误的信息,以该错误的 "type"、
|
|
"message"、"file" 和 "line" 为数组的键。
|
|
如果该错误由 PHP 内置函数导致的,"message"会以该函数名开头。
|
|
如果还没有错误则返回 <strong><code>NULL</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-459">
|
|
<p><strong>Example #1 An <span class="function"><strong>error_get_last()</strong></span> 范例</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?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">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
<div class="example-contents"><p>以上例程的输出类似于:</p></div>
|
|
<div class="example-contents screen">
|
|
<div class="cdata"><pre>
|
|
Array
|
|
(
|
|
[type] => 8
|
|
[message] => Undefined variable: a
|
|
[file] => C:\WWW\index.php
|
|
[line] => 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 class="member"><a href="errorfunc.constants.html" class="link">Error 常量</a></li>
|
|
<li class="member"><var class="varname"><var class="varname"><a href="reserved.variables.phperrormsg.html" class="classname">$php_errormsg</a></var></var> 变量</li>
|
|
<li class="member"><span class="function"><a href="error_clear_last.html" class="function" rel="rdfs-seeAlso">error_clear_last()</a> - 清除最近一次错误</span></li>
|
|
<li class="member"><a href="errorfunc.configuration.html#ini.display-errors" class="link"><code class="parameter">display_errors</code> 指令</a></li>
|
|
<li class="member"><a href="errorfunc.configuration.html#ini.html-errors" class="link"><code class="parameter">html_errors</code> 指令</a></li>
|
|
<li class="member"><a href="errorfunc.configuration.html#ini.xmlrpc-errors" class="link"><code class="parameter">xmlrpc_errors</code> 指令</a></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |