Download src/php/php-src/ext/json/tests/003.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 495 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/json/tests/003.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/json/tests/003.phpt
-
curl -L -o 003.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/json/tests/003.phpt
495 Bytes
| --TEST-- | |
| json_encode() & endless loop - 1 | |
| --FILE-- | |
| $a = array(); | |
| $a[] = &$a; | |
| var_dump($a); | |
| echo "\n"; | |
| var_dump(json_encode($a)); | |
| var_dump(json_last_error(), json_last_error_msg()); | |
| echo "\n"; | |
| var_dump(json_encode($a, JSON_PARTIAL_OUTPUT_ON_ERROR)); | |
| var_dump(json_last_error(), json_last_error_msg()); | |
| echo "Done\n"; | |
| --EXPECTF-- | |
| array(1) { | |
| [0]=> | |
| *RECURSION* | |
| } | |
| bool(false) | |
| int(6) | |
| string(%d) "Recursion detected" | |
| string(6) "[null]" | |
| int(6) | |
| string(%d) "Recursion detected" | |
| Done | |