1

I am new with php.

I am trying to run function if fatal error is occurred while trying to run another function like that

try
{
   something
}  
catch()
{
   if error try another thing
}

I searched about this problem and i found these threads

Handle fatal errors in PHP using register_shutdown_function()

How do I catch a PHP Fatal Error

But i didn't get how to run another function if error occurred

Hope i explained my problem well enough

Thanks in advance

4
  • 1
    The first thread you linked is the one you want. Commented Jun 21, 2017 at 23:55
  • What part of the answer you yourself linked to didn't you understand? Just put the reference to your function where that answer states that a fatal error has occurred. Commented Jun 21, 2017 at 23:56
  • If you're having trouble getting it to work, post what you tried and we'll help you. But we can't explain the general process any better than those questions. Commented Jun 21, 2017 at 23:58
  • You must post more code if you want to receive a viable solution. And are you sure you want to catch a "fatal error"? I have the impression, that you actually want to catch an exception, but your code doesn't work yet. Commented Jun 22, 2017 at 0:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.