Why the script does NOT show "Fatal error: Maximum execution time of XX seconds"?

Why the script does NOT show "Fatal error: Maximum execution time of XX seconds"?

我想知道为什么 php(我使用的是 5.5)不会因致命错误而停止此脚本。谢谢

<?
set_time_limit(5);
ini_set('max_execution_time', 5);
echo 'hi';
for ($i = 0; $i < 10; $i++){
    sleep(1);
}
echo '<br>bye';
?>

脚本的输出是:

hi<br>bye

没有任何错误或警告。

来自PHP docs

The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running. This is not true on Windows where the measured time is real.

解释一下这个文档的答案,它基本上意味着 sleep() 在 Linux 中不是一个耗时的函数。

Sleep(); on linux 不计入最大执行时间,请参阅用户贡献 here and the answer on the same question here