whynot 0.1.1

Rust ↔ PHP bridge: call PHP functions from Rust, capture return values, output, and exceptions.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[macro_export]
macro_rules! php_call {
    ($rt:expr, $fn:ident()) => {{ $rt.call(stringify!($fn), &[]) }};
    ($rt:expr, $fn:ident($($arg:expr),+)) => {{
        let args: Vec<$crate::PhpValue> = vec![$($arg.into()),+];
        $rt.call(stringify!($fn), &args)
    }};
}

#[macro_export]
macro_rules! php_eval { ($rt:expr, $code:expr) => {{ $rt.eval($code) }} }

#[macro_export]
macro_rules! php_include { ($rt:expr, $path:expr) => {{ $rt.include($path) }} }