Maximum error execution time

I have one script that sometimes gives a Max runtime error. This is normal, not a problem. The problem is that in this case I would write a specific error message.
How to do it?

+5
source share
2 answers
function say_goodbye() {
   if (connection_aborted()) {
      //  Perform some action if user has aborted the transaction
   } elseif (connection_status() == CONNECTION_TIMEOUT) {
      //  perform some other action if the connection has timed out
   } else {
      //  any normal completion actions
   }
}

register_shutdown_function("say_goodbye")

You can also pass parameters to the shutdown function

+4
source

All Articles