Skip to content

Conversation

@joehoyle
Copy link
Collaborator

@joehoyle joehoyle commented Feb 13, 2023

Currently it's not possible for a function to accept args by reference. This PR adds early support for doing so, by transforming any function args that are &mut T into args that are passed by reference. E.g.:

#[php_function]
fn my_function( arg: &mut Zval ) {
	arg.reference_mut().map( |zval| zval.set_bool(true) );
}

Currently it's not possible for a function to accept args by reference. This PR adds early support for doing so, by transforming any function args that are `&mut T` into args that are passed by reference. E.g.:

```
\#[php_function]
fn my_function( arg: &mut Zval ) {
	arg.reference_mut().map( |zval| zval.set_bool(true) );
}
```
@joehoyle joehoyle force-pushed the function-arg-pass-by-ref branch from b32fa61 to 614f5b4 Compare July 13, 2023 12:42
@danog danog merged commit 4dd7b8d into master Oct 10, 2023
@Xenira Xenira deleted the function-arg-pass-by-ref branch July 1, 2025 15:42
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