xref: /PHP-8.0/ext/pcre/tests/bug61780.phpt (revision 3c43510b)
1--TEST--
2Bug #61780 (Inconsistent PCRE captures in match results): basics
3--FILE--
4<?php
5preg_match('/(a)?([a-z]*)(\d*)/', '123', $matches, PREG_UNMATCHED_AS_NULL);
6var_dump($matches);
7?>
8--EXPECT--
9array(4) {
10  [0]=>
11  string(3) "123"
12  [1]=>
13  NULL
14  [2]=>
15  string(0) ""
16  [3]=>
17  string(3) "123"
18}
19