This commit is contained in:
Daniil Gentili 2023-08-27 17:24:25 +02:00
parent 4b821715b1
commit 714b1555f8
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 5 additions and 6 deletions

View File

@ -16,14 +16,14 @@ use ext_php_rs::zend::Function;
#[php_function]
pub fn test_function() -> () {
let substr = Function::from_function("var_dump");
let _ = substr.try_call(vec!["abc"]);
let var_dump = Function::from_function("var_dump");
let _ = var_dump.try_call(vec![&"abc"]);
}
#[php_function]
pub fn test_method() -> () {
let f = Function::from_method("ClassName", "staticMethod");
let _ = f.try_call(vec!["abc"]);
let _ = f.try_call(vec![&"abc"]);
}
# fn main() {}

View File

@ -24,9 +24,8 @@ use ext_php_rs::{prelude::*, types::ZendObject};
// Take an object reference and also return it.
#[php_function]
pub fn take_obj(obj: &mut ZendObject) -> &mut ZendObject {
let res = obj.try_call_method("hello", vec!["arg1", "arg2"]);
dbg!(res)
pub fn take_obj(obj: &mut ZendObject) -> () {
let _ = obj.try_call_method("hello", vec![&"arg1", &"arg2"]);
}
# #[php_module]
# pub fn get_module(module: ModuleBuilder) -> ModuleBuilder {