![]() |
1
3
我相信没有本地的PHP方法可以做到这一点。
扩展已经存在的错误处理程序以查找错误消息(
|
![]() |
2
3
您可以使用php函数 set_error_handler() to register a custom function that will handles any PHP error. Specify E_NOTICE as the second parameter so that your custom function will only receive E_NOTICE error. Then in that function, simply do 'exit;' if the second parameter which is the error message starts with 'Undefined offset:'. |
![]() |
3
2
Rather than try to hack around PHP's error handling, I suggest you enforce some constraints on your script and check your variables with PHP's
|
![]() |
4
0
I'm not sure what you want. You want to abort on notices, but not every notice? You want to distinguish between the several types of E_NOTICES and abort on some? The only way to do this is to check the message in the error handler and not abort if the message is about undefined variables â which you shouldn't use, by the way. |
![]() |
driver · 使用ggplot R绘制热图 2 年前 |
![]() |
ME Desings · 尝试从阵列复制时出现分段错误(核心转储)错误 2 年前 |
![]() |
DevelJoe · PHP异常类中的反向级联? 2 年前 |
![]() |
Sarimm Chaudhry · canot创建AR会话 2 年前 |
![]() |
felipou · Rust错误处理-捕获多个错误 2 年前 |