Download src/php/php-src/tests/strings/offsets_chaining_5.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 664 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/tests/strings/offsets_chaining_5.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/tests/strings/offsets_chaining_5.phpt
-
curl -L -o offsets_chaining_5.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/tests/strings/offsets_chaining_5.phpt
664 Bytes
| --TEST-- | |
| testing the behavior of string offset chaining | |
| --FILE-- | |
| $array = array('expected_array' => "foobar"); | |
| var_dump(isset($array['expected_array'])); | |
| var_dump($array['expected_array']); | |
| var_dump(isset($array['expected_array']['foo'])); | |
| var_dump($array['expected_array']['0foo']); | |
| var_dump(isset($array['expected_array']['foo']['bar'])); | |
| var_dump($array['expected_array']['0foo']['0bar']); | |
| --EXPECTF-- | |
| bool(true) | |
| string(6) "foobar" | |
| bool(false) | |
| Warning: Illegal string offset "0foo" in %s on line %d | |
| string(1) "f" | |
| bool(false) | |
| Warning: Illegal string offset "0foo" in %s on line %d | |
| Warning: Illegal string offset "0bar" in %s on line %d | |
| string(1) "f" | |