Note that this changes the return value in an array where every element is an array consisting of the matched string at offset 0 and it 's string offset into subject at offset 1.
If matches is provided, then it is filled with the results of search. $matches[0] will contain the text that matched the full pattern, $matches[1] will have the text that matched the first captured parenthesized subpattern, and so on.