add fatal error detection support

The orginal php syntax detection cannot detect fatal errors, this is a fix.