mirror of
https://github.com/php/php-src.git
synced 2024-12-13 11:54:45 +08:00
6eb4218433
as strings rather than casting to double and loosing precision.
18 lines
416 B
PHP
18 lines
416 B
PHP
--TEST--
|
|
json_decode() with large integers
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("json")) print "skip"; ?>
|
|
--FILE--
|
|
<?php
|
|
$json = '{"largenum":123456789012345678901234567890}';
|
|
$x = json_decode($json);
|
|
var_dump($x->largenum);
|
|
$x = json_decode($json, false, 512, JSON_BIGINT_AS_STRING);
|
|
var_dump($x->largenum);
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECT--
|
|
float(1.2345678901235E+29)
|
|
string(30) "123456789012345678901234567890"
|
|
Done
|