|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-08-12 10:00 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2020-08-12 10:00 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 13:00:01 2025 UTC |
Description: ------------ After upgrading from PHP 5.4 to 7.2 (with OS upgrade) the behavior of json_encode with JSON_NUMERIC_CHECK changed. In 5.4, a hex string was converted to an int. In 7.2, a hex string is output as a hex string. Test script: --------------- $ php --version PHP 5.4.45 (cli) (built: Oct 16 2015 11:02:47) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies $ php --interactive php > print(json_encode("0xFF", JSON_NUMERIC_CHECK)); 255 $ php --version PHP 7.2.11 (cli) (built: Oct 9 2018 15:09:36) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies $ php --interactive Interactive shell php > print(json_encode("0xFF", JSON_NUMERIC_CHECK)); "0xFF"