HEX
Server: Apache
System: Linux dinesh8189 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: cgmgerenciamento1 (814285)
PHP: 8.1.26
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //proc/thread-self/root/opt/remi/php56/root/usr/share/tests/pecl/json/tests/json_decode_float.phpt
--TEST--
Test json_decode() function with float
--SKIPIF--
<?php
if (!extension_loaded("json")) {
	die('skip JSON extension not available in this build');
}	 
?>
--FILE--
<?php
$good = "[
  3.367369e+26,
  336736864456782105775439872.000000,
  1.461826e-08,
  0.000000,
  1.391588e+22,
  13915880780094861475840.000000,
  2.116600e+23,
  211660013157571985670144.000000,
  1.120987e+32,
  112098729821300864932370706333696.000000,
  1.041024e-23,
  0.000000,
  4.131437e-13,
  0.000000,
  9.838910e+20,
  983890996017493966848.000000,
  1.540887e-17,
  0.000000,
  2.975840e+04,
  29758.400391,
  3.792641e-02,
  0.037926,
  1.710219e+10,
  17102187520.000000,
  8.060742e-11,
  0.000000,
  2.289013e+01,
  22.890127,
  1.471131e+35,
  147113100255597364294271623793475584.000000,
  2.508427e+32,
  250842668277236002726935414177792.000000,
  5.986161e+10,
  59861614592.000000,
  1.173108e+17,
  117310761037987840.000000,
  5.049736e-28,
  0.000000,
  3.715233e+08,
  371523328.000000,
  0
]";
$d = json_decode($good);
var_dump(is_array($d), count($d));

$bad = array(
	"12.34.56.78",
	"12.34e12.34",
	"12e34e56",
	"12e34.56",
);
foreach($bad as $t) {
	var_dump(json_decode($t));
}
?>
Done
--EXPECT--
bool(true)
int(41)
NULL
NULL
NULL
NULL
Done