In my current project, I found myself facing a time exceeding issue,the program was taking nearly 13 minutes to generate a report which was very unusual because the page didn’ t have any complex queries or loop to iterate. As i am working in an accounting project, it seems to be a strange problem to us. Because we have the same base class used in other two files which generate reports perfectly. So we set about to unravel the mystery but it is hard to debug a pre built framework.
In such situations, we generally use die(), exit(), print(), print_r() or echo. These are usual functions to work on. Apart from these all, PHP provides a built in function which helps us to call a function whenever a script finishes its execution. It is register_shutdown_function().