pub fn throw_if_exception() -> PhpResult<()> {
        if let Some(e) = Self::take_exception() {
            Err(crate::error::Error::Exception(e).into())
        } else {
            Ok(())
        }
    }
Attempts to extract the last PHP exception captured by the interpreter.
Returned inside a [`PhpResult`].

This function requires the executor globals to be mutably held, which
could lead to a deadlock if the globals are already borrowed immutably
or mutably.

# Errors

If an exception is present, it will be returned as `Err` value inside a
[`PhpResult`].
src/zend/globals.rs