Download src/php/php-src/ext/pcre/tests/bug42945.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pcre/tests/bug42945.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pcre/tests/bug42945.phpt
-
curl -L -o bug42945.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pcre/tests/bug42945.phpt
1.18 kB
| --TEST-- | |
| Bug #42945 (preg_split() swallows part of the string) | |
| --FILE-- | |
| <?php | |
| var_dump(preg_match_all('/\b/', "a'", $m, PREG_OFFSET_CAPTURE)); | |
| var_dump($m); | |
| var_dump(preg_split('/\b/', "a'")); | |
| var_dump(preg_split('/\b/', "a'", -1, PREG_SPLIT_OFFSET_CAPTURE)); | |
| var_dump(preg_split('/\b/', "a'", -1, PREG_SPLIT_NO_EMPTY)); | |
| var_dump(preg_split('/\b/', "a'", -1, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_OFFSET_CAPTURE)); | |
| ?> | |
| --EXPECT-- | |
| int(2) | |
| array(1) { | |
| [0]=> | |
| array(2) { | |
| [0]=> | |
| array(2) { | |
| [0]=> | |
| string(0) "" | |
| [1]=> | |
| int(0) | |
| } | |
| [1]=> | |
| array(2) { | |
| [0]=> | |
| string(0) "" | |
| [1]=> | |
| int(1) | |
| } | |
| } | |
| } | |
| array(3) { | |
| [0]=> | |
| string(0) "" | |
| [1]=> | |
| string(1) "a" | |
| [2]=> | |
| string(1) "'" | |
| } | |
| array(3) { | |
| [0]=> | |
| array(2) { | |
| [0]=> | |
| string(0) "" | |
| [1]=> | |
| int(0) | |
| } | |
| [1]=> | |
| array(2) { | |
| [0]=> | |
| string(1) "a" | |
| [1]=> | |
| int(0) | |
| } | |
| [2]=> | |
| array(2) { | |
| [0]=> | |
| string(1) "'" | |
| [1]=> | |
| int(1) | |
| } | |
| } | |
| array(2) { | |
| [0]=> | |
| string(1) "a" | |
| [1]=> | |
| string(1) "'" | |
| } | |
| array(2) { | |
| [0]=> | |
| array(2) { | |
| [0]=> | |
| string(1) "a" | |
| [1]=> | |
| int(0) | |
| } | |
| [1]=> | |
| array(2) { | |
| [0]=> | |
| string(1) "'" | |
| [1]=> | |
| int(1) | |
| } | |
| } | |