bug72787.phpt 362 B

12345678910111213141516
  1. --TEST--
  2. Bug #72787 (json_decode reads out of bounds)
  3. --SKIPIF--
  4. <?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
  5. --FILE--
  6. <?php
  7. try {
  8. var_dump(json_decode('[]', false, 0x100000000));
  9. } catch (\ValueError $e) {
  10. echo $e->getMessage() . \PHP_EOL;
  11. }
  12. ?>
  13. --EXPECTF--
  14. json_decode(): Argument #3 ($depth) must be less than %d