Lafix Lafix - 1 year ago 93
PHP Question

How to intentionally cause a fatal error in PHP script?

I want script to stop being executed at the point of the crash, while not to exhaust the memory or otherwise crash the server.

Any idea how to do that?

Answer Source

I believe this is what you're looking for:

trigger_error("Oops!", E_USER_ERROR);


E_USER_ERROR is pretty much equal to E_ERROR, which is a fatal runtime error.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download