Skip to content

Remove unnecessary check leading to FALSE return in bin2hex() #4550

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

Closed
wants to merge 1 commit into from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Aug 16, 2019

From my testing of trying to get a return value of false this check seems unnecessary as result is always a zend_string generated from php_bin2hex() [1]

Moreover, if the input argument can't be converted to a string ZPP takes care of throwing a TypeError.

If there is indeed a case where FALSE can be returned a test should be created to cover that case.

[1] https://lxr.room11.org/xref/php-src%40master/ext/standard/string.c#116

@php-pulls php-pulls closed this in 2505edb Aug 16, 2019
@Girgias Girgias deleted the remove-useless-check-bin2hex branch August 16, 2019 21:57
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.

2 participants