bug63737.phpt 826 B

1234567891011121314151617181920212223242526272829303132
  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. decode('123456789012345678901234567890');
  14. decode('-123456789012345678901234567890');
  15. // This shouldn't affect floats, but let's check that.
  16. decode('123456789012345678901234567890.1');
  17. decode('-123456789012345678901234567890.1');
  18. echo "Done\n";
  19. ?>
  20. --EXPECT--
  21. float(1.2345678901235E+29)
  22. string(30) "123456789012345678901234567890"
  23. float(-1.2345678901235E+29)
  24. string(31) "-123456789012345678901234567890"
  25. float(1.2345678901235E+29)
  26. float(1.2345678901235E+29)
  27. float(-1.2345678901235E+29)
  28. float(-1.2345678901235E+29)
  29. Done