Download src/php/php-src/ext/json/tests/004.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 531 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/json/tests/004.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/json/tests/004.phpt
-
curl -L -o 004.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/json/tests/004.phpt
531 Bytes
| --TEST-- | |
| json_encode() & endless loop - 2 | |
| --FILE-- | |
| $a = new stdclass; | |
| $a->prop = $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-- | |
| object(stdClass)#%d (1) { | |
| ["prop"]=> | |
| *RECURSION* | |
| } | |
| bool(false) | |
| int(6) | |
| string(%d) "Recursion detected" | |
| string(13) "{"prop":null}" | |
| int(6) | |
| string(%d) "Recursion detected" | |
| Done | |