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

Error: Unknown named parameter migrating from php 7.4 to 8.1 #380

Open
tobiascapin opened this issue Nov 15, 2024 · 0 comments
Open

Error: Unknown named parameter migrating from php 7.4 to 8.1 #380

tobiascapin opened this issue Nov 15, 2024 · 0 comments

Comments

@tobiascapin
Copy link

I'm migrating from php 7.4 to 8.1 and I got this error:

Unknown named parameter on \Valitron\Validator.php on line 1522

This is my code:

$input=["name"=>"test","myothervar"=>"test"];
$labels=["name"=>"Name"];
$rules=["required"=>["name"]];

$v = new Validator($input);
$v->labels($labels]);
$v->rules($rules);

I solved changing from \Valitron\Validator.php on line 1522

call_user_func_array(array($this, 'rule'), $innerParams);
to
call_user_func_array(array($this, 'rule'), array_values($innerParams));
I guess the issue depends on call_user_func_array changeloge note for php v.8.0 (https://www.php.net/manual/en/function.call-user-func-array.php)

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

No branches or pull requests

1 participant