【发布时间】:2010-12-04 09:12:44
【问题描述】:
我有一个 PHP 应用程序“index.php”,由于各种原因,它需要通过在其他脚本上使用 include_once 来运行其他 PHP 脚本。那个其他脚本不是很稳定,所以有什么方法可以做一个安全的include_once 不会停止调用者吗?
即:
<?php
safely_include_once('badfile.php'); // MAY throw syntax error, parse error, other badness
echo "I can continue execution after error";
?>
(我知道这可能是个坏主意,等等,请放心,这不是生产环境的东西。)
【问题讨论】: