Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Callback functions in php and exceptions

Tags:

php

callback

Currently I'm reading php's manual about callback functions and found interesting note:

Callbacks registered with functions such as call_user_func() and call_user_func_array() will not be called if there is an uncaught exception thrown in a previous callback.

It's obvious that script run will be interrupted in case of uncaught exception. So, why did authors of php manual additionally write that about call_user_func? Or I misunderstood the statement?

like image 737
Wild One Avatar asked Nov 12 '22 19:11

Wild One


1 Answers

That seems to me more a reminder than part of the doc. All uncaught exceptions are fatal in php, unless they were talking about call_user_func() borking even if you have set a handler (with set_exception_handler) instead of a catch, which sounds like something a lawyer would do..

like image 172
Asad Saeeduddin Avatar answered Nov 15 '22 13:11

Asad Saeeduddin