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?
I believe this is what you're looking for:
trigger_error("Oops!", E_USER_ERROR);
Docs: http://php.net/manual/en/function.trigger-error.php
E_USER_ERROR is pretty much equal to E_ERROR, which is a fatal runtime error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With