pub fn run<R, F: FnMut() -> R + RefUnwindSafe>(func: F) -> R
    where
        R: Default,
    {
        // @TODO handle php thread safe
        //
        // This is to prevent multiple threads from running php at the same time
        // At some point we should detect if php is compiled with thread safety and
        // avoid doing that in this case
        let _guard = RUN_FN_LOCK.write();

        let panic = unsafe {
            ext_php_rs_embed_callback(
                0,
                null_mut(),
                panic_wrapper::<R, F>,
                (&raw const func).cast::<c_void>(),
            )
        };

        // This can happen if there is a bailout
        if panic.is_null() {
            return R::default();
        }

        match unsafe { *Box::from_raw(panic.cast::<std::thread::Result<R>>()) } {
            Ok(r) => r,
            Err(err) => {
                // we resume the panic here so it can be caught correctly by the test framework
                resume_unwind(err);
            }
        }
    }
Start and run embed sapi engine

This function will allow to run php code from rust, the same PHP context
is keep between calls inside the function passed to this method.
Which means subsequent calls to `Embed::eval` or `Embed::run_script`
will be able to access variables defined in previous calls

# Returns

* R - The result of the function passed to this method

R must implement [`Default`] so it can be returned in case of a bailout

# Example

```
use ext_php_rs::embed::Embed;

Embed::run(|| {
let _ = Embed::eval("$foo = 'foo';");
let foo = Embed::eval("$foo;");
assert!(foo.is_ok());
assert_eq!(foo.unwrap().string().unwrap(), "foo");
});
```
src/embed/mod.rs