无限循环 - 忽略错误并继续?

I create the code for the infinite loop like this:

<?php
    while(1) {
        "some code"
    }
?>

Now the problem is that some times the internet connection goes down. Sometimes fatal errors occur. That's why the loop process stops. I want to run the loop forever - ignore the all the errors, warnings and notices, and run the loop forever. How do I do this?

you can increase server timeout for running script

in php.ini file

max_execution_time=-1 

PHP

if(set_time_limit (-1))
{
    while(1)
    {
        "some code";
    }
}
else
{
    echo "error occured";
}