How can I tell where exit or die is being called from within a php script

I have a PHP script that hooks into WordPress (through wp-load.php) to do various things. For some reason, during the script, after running update_post_meta (its in a loop), the script just stops. No errors, exceptions. Nothing.

I registered a shutdown function and it was called, so to me, it seems that another plugin somehow is calling die or exit. Is there a way to find out where this is being called? Perhaps a backtrace of some sort?

Related posts

3 comments

  1. This is not possible. There is no way to easily and reliable trap the die() and exit() your need to check in each file filtration modify date

  2. So like Sunil Kumar Sain said there is no reliable way to trap die() and exit() but you can find php errors in wp. You can turn on wp debug to true. You can find it in wp-config.php file in wordpress root directory.
    It would be great that others add more ways of catching errors. Feel free to edit this.

Comments are closed.