@@ -365,6 +365,26 @@ function bug11291(string $s): void {
365
365
assertType ('array{}|array{0: string, 1: string, 2?: string, 3?: string} ' , $ matches );
366
366
}
367
367
368
+ function bug11323a (string $ s ): void
369
+ {
370
+ if (preg_match ('/Price: (?P<currency>£|€)\d+/ ' , $ s , $ matches )) {
371
+ assertType ('array{0: string, currency: string, 1: string} ' , $ matches );
372
+ } else {
373
+ assertType ('array{} ' , $ matches );
374
+ }
375
+ assertType ('array{}|array{0: string, currency: string, 1: string} ' , $ matches );
376
+ }
377
+
378
+ function bug11323b (string $ s ): void
379
+ {
380
+ if (preg_match ('/Price: (?<currency>£|€)\d+/ ' , $ s , $ matches )) {
381
+ assertType ('array{0: string, currency: string, 1: string} ' , $ matches );
382
+ } else {
383
+ assertType ('array{} ' , $ matches );
384
+ }
385
+ assertType ('array{}|array{0: string, currency: string, 1: string} ' , $ matches );
386
+ }
387
+
368
388
function unmatchedAsNullWithMandatoryGroup (string $ s ): void {
369
389
if (preg_match ('/Price: (?<currency>£|€)\d+/ ' , $ s , $ matches , PREG_UNMATCHED_AS_NULL )) {
370
390
assertType ('array{0: string, currency: string, 1: string} ' , $ matches );
0 commit comments