How can I test a script going beyond its max time limit ?

My work : Sometimes when we run scripts from the browser and suddenly we get white screen without any error. Even i have faced this when i was exporting product from magento store.So after few hours of search i came across above question.
Ans:
A function registered with register_shutdown_function will be called when the execution time limit is reached. You can test the limit with a busy wait:

<?php
   register_shutdown_function(function() {
       echo “shutdown function called\n”;
   }
   set_time_limit(1); // Set time limit to 1 second (optional)
   for (;;) ;         // Busy wait
?>

Source:http://stackoverflow.com/questions/7666919/php-script-test-max-execution-time

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s