$php_errormsg — 前一個(gè)錯(cuò)誤信息
本特性已自 PHP 7.2.0 起廢棄。強(qiáng)烈建議不要使用本特性。
用 error_get_last() 函數(shù)代替。
$php_errormsg 變量包含由 PHP 生成的最新錯(cuò)誤信息。這個(gè)變量只在錯(cuò)誤發(fā)生的作用域內(nèi)可用,并且要求 track_errors 配置項(xiàng)是開(kāi)啟的(默認(rèn)是關(guān)閉的)。
如果用戶定義了錯(cuò)誤處理句柄(set_error_handler())并且返回 false
的時(shí)候,$php_errormsg 就會(huì)被設(shè)置。
版本 | 說(shuō)明 |
---|---|
8.0.0 | 可使 $php_errormsg 可用的 track_errors 指令已被刪除。 |
7.2.0 | 可使 $php_errormsg 可用的 track_errors 指令已被棄用。 |
示例 #1 $php_errormsg 范例
<?php
@strpos();
echo $php_errormsg;
?>
以上例程的輸出類似于:
Wrong parameter count for strpos()