Skip to content

Instantly share code, notes, and snippets.

@muhqu
Created March 13, 2012 13:58
Show Gist options
  • Select an option

  • Save muhqu/2028927 to your computer and use it in GitHub Desktop.

Select an option

Save muhqu/2028927 to your computer and use it in GitHub Desktop.
<?php
function logMsg($str) {
syslog(LOG_ERR, microtime()." | connection_status() = ".connection_status()." | ".$str."\n");
}
register_shutdown_function(function(){
logMsg("shutdown");
});
logMsg("start");
for ($i=0; $i<10; $i++) {
if (connection_status()!=0){
logMsg("die");
die;
}
logMsg("sleep");
print "X";
flush();
sleep(1);
}
logMsg("finish");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment