Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for variadic functions #300

Merged
merged 3 commits into from
Dec 1, 2023
Merged

Support for variadic functions #300

merged 3 commits into from
Dec 1, 2023

Conversation

joehoyle
Copy link
Collaborator

@joehoyle joehoyle commented Nov 30, 2023

When a function is created with #[php_function], if the last param of the Rust function is &[&Zval], it will be treated as the variadic argument in PHP.

#[php_function]
fn my_func( name: &str, args: &[&Zval] ) {
    dbg!(args);
}

Called from PHP:

my_funct( 'joe', 1, 2, 3, 4, 5 );

When a function is created with `#[php_function]`, if the last param of the Rust function is `&[&Zval]`, it will be treated as the variadic argument in PHP.
@danog
Copy link
Collaborator

danog commented Nov 30, 2023

Thanks, could you also update the docs pls?

Also, do you think you could find some time to take a look at #294? I don't have a mac machine so debugging that issue would be kinda tricky.

@danog danog merged commit a002e98 into master Dec 1, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants