]> granicus.if.org Git - php/commitdiff
added test to clearly show distinction between unset (aka unmatched) subpattern and...
authorChristoph M. Becker <cmbecker69@gmx.de>
Sat, 23 May 2015 18:34:06 +0000 (20:34 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sat, 23 May 2015 18:34:06 +0000 (20:34 +0200)
ext/pcre/tests/bug61780.phpt [new file with mode: 0644]

diff --git a/ext/pcre/tests/bug61780.phpt b/ext/pcre/tests/bug61780.phpt
new file mode 100644 (file)
index 0000000..25b1e13
--- /dev/null
@@ -0,0 +1,18 @@
+--TEST--
+Bug #61780 (Inconsistent PCRE captures in match results): basics
+--FILE--
+<?php
+preg_match('/(a)?([a-z]*)(\d*)/', '123', $matches);
+var_dump($matches);
+?>
+--EXPECT--
+array(4) {
+  [0]=>
+  string(3) "123"
+  [1]=>
+  NULL
+  [2]=>
+  string(0) ""
+  [3]=>
+  string(3) "123"
+}