Download src/php/php-src/ext/json/tests/bug41504.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 481 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/json/tests/bug41504.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/json/tests/bug41504.phpt
-
curl -L -o bug41504.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/json/tests/bug41504.phpt
481 Bytes
| --TEST-- | |
| Bug #41504 (json_decode() converts empty array keys to "_empty_") | |
| --FILE-- | |
| var_dump(json_decode('{"":"value"}', true)); | |
| var_dump(json_decode('{"":"value", "key":"value"}', true)); | |
| var_dump(json_decode('{"key":"value", "":"value"}', true)); | |
| echo "Done\n"; | |
| --EXPECT-- | |
| array(1) { | |
| [""]=> | |
| string(5) "value" | |
| } | |
| array(2) { | |
| [""]=> | |
| string(5) "value" | |
| ["key"]=> | |
| string(5) "value" | |
| } | |
| array(2) { | |
| ["key"]=> | |
| string(5) "value" | |
| [""]=> | |
| string(5) "value" | |
| } | |
| Done | |