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

String with IP-address recognized as float by json_decode #29

Closed
cmb69 opened this issue Jul 12, 2016 · 2 comments
Closed

String with IP-address recognized as float by json_decode #29

cmb69 opened this issue Jul 12, 2016 · 2 comments

Comments

@cmb69
Copy link

@cmb69 cmb69 commented Jul 12, 2016

var_dump(json_decode('10.7.11.122'));

outputs

10.7

which is certainly unexpected.

Respective PHP-Info:

json support => enabled
json version => 1.3.6
JSON-C headers version => 0.11.99
JSON-C library version => 0.11.99

This was originally reported as https://bugs.php.net/72574 which doesn't seem to be the proper place to report json-c issues, as the PECL page says this is the appropriate issue tracker.

@remicollet

This comment has been minimized.

Copy link
Owner

@remicollet remicollet commented Jul 12, 2016

You use an outdated version.

$ php -r 'var_dump(json_decode("10.7.11.122"));'
NULL

@remicollet remicollet closed this Jul 12, 2016
@cmb69

This comment has been minimized.

Copy link
Author

@cmb69 cmb69 commented Jul 12, 2016

Indeed, that has been already fixed with c24fdc6, as pointed out by Nikita in the PHP bug tracker. It's a Debian issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.