diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-15 11:26:59 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-15 12:03:18 +0200 |
| commit | d81ea5e9285d0eb49c730e1ea7cccf3fefa1fad5 (patch) | |
| tree | b73ee4ebf270bea814263996bbd062000c5d0b79 /ext/pcre/tests | |
| parent | da0663a337b608a4b0008672b494e3a71e6e4cfc (diff) | |
| download | php-git-d81ea5e9285d0eb49c730e1ea7cccf3fefa1fad5.tar.gz | |
Fix preg_replace_callback_array() with array subject
Apparently this "feature" was completely untested...
Diffstat (limited to 'ext/pcre/tests')
| -rw-r--r-- | ext/pcre/tests/bug73392.phpt | 2 | ||||
| -rw-r--r-- | ext/pcre/tests/preg_replace_callback_array.phpt | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/ext/pcre/tests/bug73392.phpt b/ext/pcre/tests/bug73392.phpt index 704cc3d351..7546f5d99f 100644 --- a/ext/pcre/tests/bug73392.phpt +++ b/ext/pcre/tests/bug73392.phpt @@ -22,6 +22,4 @@ var_dump(preg_replace_callback_array( ?> --EXPECTF-- Warning: preg_replace_callback_array(): Delimiter must not be alphanumeric or backslash in %sbug73392.php on line %d - -Warning: preg_replace_callback_array(): Delimiter must not be alphanumeric or backslash in %sbug73392.php on line %d NULL diff --git a/ext/pcre/tests/preg_replace_callback_array.phpt b/ext/pcre/tests/preg_replace_callback_array.phpt index ffefa2cc26..cf872547f3 100644 --- a/ext/pcre/tests/preg_replace_callback_array.phpt +++ b/ext/pcre/tests/preg_replace_callback_array.phpt @@ -39,11 +39,21 @@ var_dump(preg_replace_callback_array( "/c/" => new Rep, "/a/" => 'b', "/b/" => function($a) { return "ok"; }), 'a', -1, $count)); - var_dump($count); + +var_dump(preg_replace_callback_array( + array('/a/' => 'b', "/c/" => new Rep), + array('a', 'c'))); + ?> --EXPECT-- string(2) "ok" string(2) "ok" string(2) "ok" int(2) +array(2) { + [0]=> + string(1) "b" + [1]=> + string(1) "d" +} |
