-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Description
When declare function/method with macros, it's generate nullable params.
Steps to Reproduce
In rust declare a struct with function with default value. In macro crate function.rs on nullable check it's set nullable for default value.
For me it's weird, but maybe only for me)
Example
Extension Code:
#[php_class]
#[php(name = "Rust\\A")]
struct A;
#[php_impl]
impl A {
#[php(defaults(value = 0))]
pub fn test(value: i32) -> i32 {
value
}
}
PHP Code:
<?php
$test = new Rust\A;
// Will work find
var_dump($test->test(null));
Expected Behavior
Should be error.
Log Output
Affected Components
- ext-php-rs
- macros
- cli (cargo-php)
PHP Version
PHP 8.4
ext-php-rs
Version
0.4.12
Operating System
Archlinux
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working