xref: /PHP-7.0/ext/json/tests/bug63737.phpt (revision e5abc537)
1--TEST--
2Bug #63737 (json_decode does not properly decode with options parameter)
3--SKIPIF--
4<?php if (!extension_loaded("json")) print "skip"; ?>
5--FILE--
6<?php
7function decode($json) {
8	$x = json_decode($json);
9	var_dump($x);
10	$x = json_decode($json, false, 512, JSON_BIGINT_AS_STRING);
11	var_dump($x);
12}
13
14decode('123456789012345678901234567890');
15decode('-123456789012345678901234567890');
16
17// This shouldn't affect floats, but let's check that.
18decode('123456789012345678901234567890.1');
19decode('-123456789012345678901234567890.1');
20
21echo "Done\n";
22?>
23--EXPECT--
24float(1.2345678901235E+29)
25string(30) "123456789012345678901234567890"
26float(-1.2345678901235E+29)
27string(31) "-123456789012345678901234567890"
28float(1.2345678901235E+29)
29float(1.2345678901235E+29)
30float(-1.2345678901235E+29)
31float(-1.2345678901235E+29)
32Done
33