@@ -300,7 +300,7 @@ function (string $size): void {
300300 if (preg_match ('~^a\.(b)?(c)?d~ ' , $ size , $ matches ) !== 1 ) {
301301 throw new InvalidArgumentException (sprintf ('Invalid size "%s" ' , $ size ));
302302 }
303- assertType ("array {0: non-falsy-string, 1?: ''|'b', 2?: 'c'} " , $ matches );
303+ assertType ("list {0: non-falsy-string, 1?: ''|'b', 2?: 'c'} " , $ matches );
304304};
305305
306306function (string $ size ): void {
@@ -525,15 +525,15 @@ function bug11323(string $s): void {
525525
526526function (string $ s ): void {
527527 preg_match ('/%a(\d*)/ ' , $ s , $ matches );
528- assertType ("array {0?: string, 1?: ''|numeric-string} " , $ matches );
528+ assertType ("list {0?: string, 1?: ''|numeric-string} " , $ matches );
529529};
530530
531531class Bug11376
532532{
533533 public function test (string $ str ): void
534534 {
535535 preg_match ('~^(?:(\w+)::)?(\w+)$~ ' , $ str , $ matches );
536- assertType ('array {0?: string, 1?: string, 2?: non-empty-string} ' , $ matches );
536+ assertType ('list {0?: string, 1?: string, 2?: non-empty-string} ' , $ matches );
537537 }
538538
539539 public function test2 (string $ str ): void
@@ -564,7 +564,7 @@ function (string $s): void {
564564 }
565565
566566 if (preg_match ($ p , $ s , $ matches )) {
567- assertType ("array {0: non-falsy-string, 1: 'x'|'£'|numeric-string, 2?: ''|numeric-string, 3?: 'x'} " , $ matches );
567+ assertType ("list {0: non-falsy-string, 1: 'x'|'£'|numeric-string, 2?: ''|numeric-string, 3?: 'x'} " , $ matches );
568568 }
569569};
570570
@@ -730,7 +730,7 @@ function (string $s): void {
730730
731731function (string $ s ): void {
732732 preg_match ('~a|(\d)|(\s)~ ' , $ s , $ matches );
733- assertType ("array {0?: string, 1?: '', 2?: non-empty-string}|array {0?: string, 1?: numeric-string} " , $ matches );
733+ assertType ("list {0?: string, 1?: '', 2?: non-empty-string}|list {0?: string, 1?: numeric-string} " , $ matches );
734734};
735735
736736function bug11490 (string $ expression ): void {
@@ -762,13 +762,13 @@ function bug11604 (string $string): void {
762762 return ;
763763 }
764764
765- assertType ("array {0: non-empty-string, 1?: ''|'XX', 2?: 'YY'} " , $ matches );
765+ assertType ("list {0: non-empty-string, 1?: ''|'XX', 2?: 'YY'} " , $ matches );
766766 // could be array{string, '', 'YY'}|array{string, 'XX'}|array{string}
767767}
768768
769769function bug11604b (string $ string ): void {
770770 if (preg_match ('/(XX)|(YY)?(ZZ)/ ' , $ string , $ matches )) {
771- assertType ("array {0: non-empty-string, 1?: ''|'XX', 2?: ''|'YY', 3?: 'ZZ'} " , $ matches );
771+ assertType ("list {0: non-empty-string, 1?: ''|'XX', 2?: ''|'YY', 3?: 'ZZ'} " , $ matches );
772772 }
773773}
774774
@@ -935,11 +935,11 @@ function bugEmptySubexpression (string $string): void {
935935 }
936936
937937 if (preg_match ('~((a)||(b))~ ' , $ string , $ matches )) {
938- assertType ("array {0: string, 1: ''|'a'|'b', 2?: ''|'a', 3?: 'b'} " , $ matches );
938+ assertType ("list {0: string, 1: ''|'a'|'b', 2?: ''|'a', 3?: 'b'} " , $ matches );
939939 }
940940
941941 if (preg_match ('~((a)|()|(b))~ ' , $ string , $ matches )) {
942- assertType ("array {0: string, 1: ''|'a'|'b', 2?: ''|'a', 3?: '', 4?: 'b'} " , $ matches );
942+ assertType ("list {0: string, 1: ''|'a'|'b', 2?: ''|'a', 3?: '', 4?: 'b'} " , $ matches );
943943 }
944944}
945945
@@ -1010,3 +1010,8 @@ function bug12749f(string $str): void
10101010 assertType ('array{non-empty-string} ' , $ match ); // could be numeric-string
10111011 }
10121012}
1013+
1014+ function bug12397 (string $ string ) : array {
1015+ $ m = preg_match ('#\b([A-Z]{2,})-(\d+)# ' , $ string , $ match );
1016+ assertType ('list{0?: string, 1?: non-falsy-string, 2?: numeric-string} ' , $ match );
1017+ }
0 commit comments