pheromix pheromix - 1 month ago 24
PHP Question

Does trigger_error interrupt script?

In runtime the log file contains the message I set to the argument of

trigger_error
. The page is blank after that ! Is it possible to continue code execution after
trigger_error
?

Answer

No, trigger_error() does not stop execution unless you pass the second argument as E_USER_ERROR. By default it triggers a warning. You must have an error at some point after the call.

Trigger Warning:

trigger_error("CTest message"); // defaults to E_USER_NOTICE

Trigger Fatal Error:

trigger_error("Test message", E_USER_ERROR);