Download src/php/php-src/ext/json/tests/bug68992.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 562 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/json/tests/bug68992.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/json/tests/bug68992.phpt
-
curl -L -o bug68992.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/json/tests/bug68992.phpt
562 Bytes
| --TEST-- | |
| Bug #68992 (json_encode stacks exceptions thrown by JsonSerializable classes) | |
| --FILE-- | |
| class MyClass implements JsonSerializable { | |
| public function jsonSerialize(): mixed { | |
| throw new Exception('Not implemented!'); | |
| } | |
| } | |
| $classes = []; | |
| for($i = 0; $i < 5; $i++) { | |
| $classes[] = new MyClass(); | |
| } | |
| try { | |
| json_encode($classes); | |
| } catch(Exception $e) { | |
| do { | |
| printf("%s (%d) [%s]\n", $e->getMessage(), $e->getCode(), get_class($e)); | |
| } while ($e = $e->getPrevious()); | |
| } | |
| --EXPECT-- | |
| Not implemented! (0) [Exception] | |