diff options
Diffstat (limited to 'ext/pcre/tests/grep.phpt')
-rw-r--r-- | ext/pcre/tests/grep.phpt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/pcre/tests/grep.phpt b/ext/pcre/tests/grep.phpt new file mode 100644 index 0000000..d3d9032 --- /dev/null +++ b/ext/pcre/tests/grep.phpt @@ -0,0 +1,23 @@ +--TEST-- +preg_grep() +--FILE-- +<?php +$array = array('a', '1', 'q6', 'h20'); + +var_dump(preg_grep('/^(\d|.\d)$/', $array)); +var_dump(preg_grep('/^(\d|.\d)$/', $array, PREG_GREP_INVERT)); + +?> +--EXPECT-- +array(2) { + [1]=> + string(1) "1" + [2]=> + string(2) "q6" +} +array(2) { + [0]=> + string(1) "a" + [3]=> + string(3) "h20" +} |