Skip to content

Commit

Permalink
added test to clearly show distinction between unset (aka unmatched) …
Browse files Browse the repository at this point in the history
…subpattern and an empty match
  • Loading branch information
cmb69 committed May 23, 2015
1 parent 303b365 commit 5ca664a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ext/pcre/tests/bug61780.phpt
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 5ca664a

Please sign in to comment.