xref: /PHP-8.4/ext/json/tests/bug72787.phpt (revision 32a1ebbd)
1--TEST--
2Bug #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
8try {
9    var_dump(json_decode('[]', false, 0x100000000));
10} catch (\ValueError $e) {
11    echo $e->getMessage() . \PHP_EOL;
12}
13
14?>
15--EXPECTF--
16json_decode(): Argument #3 ($depth) must be less than %d
17