如下程序:<?php
header('Content-Type:text/html;charset=utf-8');function customError($errno, $errstr, $errfile, $errline) {
echo '<b>错误代码:</b>['.$errno.'] '.$errstr.PHP_EOL;
echo '错误所在的代码行:'.$errline.' 文件'.$errfile.PHP_EOL;
echo 'PHP版本:'.PHP_VERSION.'('.PHP_OS.')'.PHP_EOL;
die();
}
set_error_handler('customError', E_ALL|E_STRICT);
$a = array('o' => 2, 4, 6, 8);
echo $a[o];输出:
错误代码:[8] Use of undefined constant o - assumed 'o' 错误所在的代码行:12 文件/usr/local/apache/htdocs/mytest/test2.php PHP版本:5.4.19(Linux) 中间没有任何换行,为什么呢??我的环境是centos