Skip to content

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
@Xenira Xenira deleted the variadic-support branch July 1, 2025 15:36
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.

3 participants