Annotation of embedaddon/php/ext/json/tests/bug63737.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #63737 (json_decode does not properly decode with options parameter)
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("json")) print "skip"; ?>
! 5: --FILE--
! 6: <?php
! 7: function 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:
! 14: decode('123456789012345678901234567890');
! 15: decode('-123456789012345678901234567890');
! 16:
! 17: // This shouldn't affect floats, but let's check that.
! 18: decode('123456789012345678901234567890.1');
! 19: decode('-123456789012345678901234567890.1');
! 20:
! 21: echo "Done\n";
! 22: ?>
! 23: --EXPECT--
! 24: float(1.2345678901235E+29)
! 25: string(30) "123456789012345678901234567890"
! 26: float(-1.2345678901235E+29)
! 27: string(31) "-123456789012345678901234567890"
! 28: float(1.2345678901235E+29)
! 29: float(1.2345678901235E+29)
! 30: float(-1.2345678901235E+29)
! 31: float(-1.2345678901235E+29)
! 32: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>