@@ -15,21 +15,21 @@ function (string $s): void {
1515 assertType ('array{string, string}|null ' , $ result );
1616
1717 $ result = Strings::match ($ s , '/(foo)(bar)(baz)/ ' , PREG_OFFSET_CAPTURE );
18- assertType (' array{array{string, int<0, max>}, array{non-empty-string , int<0, max>}, array{non-empty-string , int<0, max>}, array{non-empty-string , int<0, max>}}|null ' , $ result );
18+ assertType (" array{array{string, int<0, max>}, array{'foo' , int<0, max>}, array{'bar' , int<0, max>}, array{'baz' , int<0, max>}}|null " , $ result );
1919
2020 $ result = Strings::match ($ s , '/(foo)(bar)(baz)/ ' );
21- assertType (' array{string, non-empty-string, non-empty-string, non-empty-string }|null ' , $ result );
21+ assertType (" array{string, 'foo', 'bar', 'baz' }|null " , $ result );
2222
2323 $ result = Strings::match ($ s , '/(foo)(bar) ' . preg_quote ($ s ) .'(baz)/ ' );
24- assertType (' array{string, non-empty-string, non-empty-string, non-empty-string }|null ' , $ result );
24+ assertType (" array{string, 'foo', 'bar', 'baz' }|null " , $ result );
2525};
2626
2727function (string $ s ): void {
2828 $ result = Strings::matchAll ($ s , '/ab(?P<num>\d+)(?P<suffix>ab)?/ ' , PREG_SET_ORDER );
29- assertType ("list<array{0: string, num: numeric-string, 1: numeric-string, suffix?: non-empty-string , 2?: non-empty-string }> " , $ result );
29+ assertType ("list<array{0: string, num: numeric-string, 1: numeric-string, suffix?: 'ab' , 2?: 'ab' }> " , $ result );
3030};
3131
3232function (string $ s ): void {
3333 $ result = Strings::matchAll ($ s , '/ab(?P<num>\d+)(?P<suffix>ab)?/ ' , PREG_PATTERN_ORDER );
34- assertType ("array{0: list<string>, num: list<numeric-string>, 1: list<numeric-string>, suffix: list<string >, 2: list<string >} " , $ result );
34+ assertType ("array{0: list<string>, num: list<numeric-string>, 1: list<numeric-string>, suffix: list<''|'ab' >, 2: list<''|'ab' >} " , $ result );
3535};
0 commit comments