bug63737.phpt 791 B

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