1

If I do something inside my extension that could produce warnings or fatals, how I can catch them?

I suppose that some global variables control this, but don't know which one.

Kypros
  • 2,997
  • 5
  • 21
  • 27
nkt
  • 181
  • 1
  • 9
  • My PHP expertise is limited so I might miss the obvious but to which kind of "*warnings or fatals*" are you referring to? – alk Oct 26 '14 at 16:16
  • In userspace of PHP we can call `set_error_handler` for errors catching. I need this feature inside C code. I guess there is global variable for this. – nkt Oct 26 '14 at 16:22
  • Look at this http://stackoverflow.com/questions/1241728/can-i-try-catch-a-warning – Dangeroustry Oct 26 '14 at 16:22
  • This one for userspace PHP. I asked about C-API. – nkt Oct 26 '14 at 17:36

1 Answers1

0

C does not know exceptions, try/catch/finally are not avaliable.

You need to use other mechanics to detect errors and handle them.

Ok, ok - there is setjmp() and longjmp(), but ...

alk
  • 69,737
  • 10
  • 105
  • 255