JD *_*cks 3 php error-reporting
这是我的代码:
echo 'foo';
error_reporting(E_ALL);
echo 'this line doesnt end in a semi colon'
echo 'i should get an error here';
Run Code Online (Sandbox Code Playgroud)
当我运行这个时,我没有得到任何错误.
不知道这是怎么回事?
rek*_*o_t 12
ini_set('display_errors', 1);
Run Code Online (Sandbox Code Playgroud)
请注意,如果你在具有语法错误的文件中执行此操作,它将无法工作,因为它永远不会被执行.你也可以在php.ini中设置为true(不建议用于生产服务器),或者如果你在.htaccess中使用Apache,则:
php_flag display_errors 1
Run Code Online (Sandbox Code Playgroud)