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

bindec give ( ! ) Deprecated: Invalid characters passed for attempted conversion, these have been ignored in php 7.4.x #15

Closed
simongcc opened this issue Feb 10, 2021 · 3 comments

Comments

@simongcc
Copy link

Hi! It seems that php 7.4.x is more strict in checking arguments and function bindec expects 0 and 1 only string so it give the warning.

( ! ) Deprecated: Invalid characters passed for attempted conversion, these have been ignored in benchmark.php on line 183

@odan
Copy link
Collaborator

odan commented Feb 14, 2021

Would you like to create a PR to fix it?

@Kristian-Tan
Copy link

This isn't fixed yet? I propose to either remove the bindec function altogether from benchmark OR add an if statement like this:

alternative 1: remove the bindec function altogether

- 183: $mathFunctions = array("abs", "acos", "asin", "atan", "bindec", "floor", "exp", "sin", "tan", "is_finite", "is_nan", "sqrt");
+ 183: $mathFunctions = array("abs", "acos", "asin", "atan", "floor", "exp", "sin", "tan", "is_finite", "is_nan", "sqrt");

alternative 2: add an if statement, if $function is "bindec" then call_user_func_array($function, array(decbin($i))); else call_user_func_array($function, array($i));

- 186: call_user_func_array($function, array($i));
+ 186: if($function == "bindec") call_user_func_array($function, array(decbin($i)));
+ 187: else call_user_func_array($function, array($i));

If you approve any of the 2 above, I'll make a PR

odan added a commit that referenced this issue Mar 7, 2021
@odan
Copy link
Collaborator

odan commented Mar 7, 2021

This bug has been fixed. Please try it again.

@odan odan closed this as completed Mar 7, 2021
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

3 participants