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] #[php_function]
pub fn test_function() -> () { pub fn test_function() -> () {
let substr = Function::from_function("var_dump"); let var_dump = Function::from_function("var_dump");
let _ = substr.try_call(vec!["abc"]); let _ = var_dump.try_call(vec![&"abc"]);
} }
#[php_function] #[php_function]
pub fn test_method() -> () { pub fn test_method() -> () {
let f = Function::from_method("ClassName", "staticMethod"); let f = Function::from_method("ClassName", "staticMethod");
let _ = f.try_call(vec!["abc"]); let _ = f.try_call(vec![&"abc"]);
} }
# fn main() {} # fn main() {}

View File

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