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

MahdiY
  • 1,269
  • 21
  • 32
  • 1
    The first thread you linked is the one you want. – Enstage Jun 21 '17 at 23:55
  • What part of [**the answer**](https://stackoverflow.com/a/4410769/2341603) 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. – Obsidian Age Jun 21 '17 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. – Barmar Jun 21 '17 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. –  Jun 22 '17 at 00:12

0 Answers0