@@ -605,12 +605,12 @@ public function testArrayReduceCallback(): void
605605 5 ,
606606 ],
607607 [
608- sprintf ('Parameter #2 $callback of function array_reduce expects callable(non-empty-string |null, 1|2|3): (non-empty-string |null), Closure(string, int): %s given. ' , getenv ('PHPSTAN_FNSR ' ) !== '0 ' && PHP_VERSION_ID >= 80100 ? 'non-empty -string ' : 'non-falsy -string ' ),
608+ sprintf ('Parameter #2 $callback of function array_reduce expects callable(%1$s |null, 1|2|3): (%1$s |null), Closure(string, int): non-falsy-string given. ' , getenv ('PHPSTAN_FNSR ' ) !== '0 ' && PHP_VERSION_ID >= 80100 ? 'non-falsy -string ' : 'non-empty -string ' ),
609609 13 ,
610610 'Type string of parameter #1 $foo of passed callable needs to be same or wider than parameter type string|null of accepting callable. ' ,
611611 ],
612612 [
613- sprintf ('Parameter #2 $callback of function array_reduce expects callable(non-empty-string |null, 1|2|3): (non-empty-string |null), Closure(string, int): %s given. ' , getenv ('PHPSTAN_FNSR ' ) !== '0 ' && PHP_VERSION_ID >= 80100 ? 'non-empty -string ' : 'non-falsy -string ' ),
613+ sprintf ('Parameter #2 $callback of function array_reduce expects callable(%1$s |null, 1|2|3): (%1$s |null), Closure(string, int): non-falsy-string given. ' , getenv ('PHPSTAN_FNSR ' ) !== '0 ' && PHP_VERSION_ID >= 80100 ? 'non-falsy -string ' : 'non-empty -string ' ),
614614 22 ,
615615 'Type string of parameter #1 $foo of passed callable needs to be same or wider than parameter type string|null of accepting callable. ' ,
616616 ],
@@ -683,7 +683,7 @@ public function testArrayUdiffCallback(): void
683683 6 ,
684684 ],
685685 [
686- sprintf ( ' Parameter #3 $data_comp_func of function array_udiff expects callable(1|2|3|4|5|6, 1|2|3|4|5|6): int, Closure(int, int): %s given. ' , getenv ( ' PHPSTAN_FNSR ' ) !== ' 0 ' && PHP_VERSION_ID >= 80100 ? ' (lowercase-string&non-falsy-string&uppercase-string) ' : " (' 11'|'12'|'13'|'14'|'15'|'16'|'21'|'22'|'23'|'24'|'25'|'26'|'31'|'32'|'33'|'34'|'35'|'36'|'41'|'42'|'43'|'44'|'45'|'46'|'51'|'52'|'53'|'54'|'55'|'56'|'61'|'62'|'63'|'64'|'65'|'66')" ) ,
686+ " Parameter #3 \ $data_comp_func of function array_udiff expects callable(1|2|3|4|5|6, 1|2|3|4|5|6): int, Closure(int, int): (' 11'|'12'|'13'|'14'|'15'|'16'|'21'|'22'|'23'|'24'|'25'|'26'|'31'|'32'|'33'|'34'|'35'|'36'|'41'|'42'|'43'|'44'|'45'|'46'|'51'|'52'|'53'|'54'|'55'|'56'|'61'|'62'|'63'|'64'|'65'|'66') given. " ,
687687 14 ,
688688 ],
689689 [
@@ -935,7 +935,7 @@ public function testArrayAllCallback(): void
935935 30 ,
936936 ],
937937 [
938- sprintf ( 'Parameter #2 $callback of function array_all expects callable(1|2, \'bar \'| \'foo \'): bool, Closure(int, string): %s given. ' , getenv ( ' PHPSTAN_FNSR ' ) !== ' 0 ' && PHP_VERSION_ID >= 80100 ? ' string ' : ' ( \'bar \'| \'foo \') ' ) ,
938+ 'Parameter #2 $callback of function array_all expects callable(1|2, \'bar \'| \'foo \'): bool, Closure(int, string): ( \'bar \'| \'foo \') given. ' ,
939939 36 ,
940940 ],
941941 [
@@ -962,7 +962,7 @@ public function testArrayAnyCallback(): void
962962 30 ,
963963 ],
964964 [
965- sprintf ( 'Parameter #2 $callback of function array_any expects callable(1|2, \'bar \'| \'foo \'): bool, Closure(int, string): %s given. ' , getenv ( ' PHPSTAN_FNSR ' ) !== ' 0 ' && PHP_VERSION_ID >= 80100 ? ' string ' : ' ( \'bar \'| \'foo \') ' ) ,
965+ 'Parameter #2 $callback of function array_any expects callable(1|2, \'bar \'| \'foo \'): bool, Closure(int, string): ( \'bar \'| \'foo \') given. ' ,
966966 36 ,
967967 ],
968968 [
@@ -988,7 +988,7 @@ public function testArrayFindCallback(): void
988988 30 ,
989989 ],
990990 [
991- sprintf ( 'Parameter #2 $callback of function array_find expects callable(1|2, \'bar \'| \'foo \'): bool, Closure(int, string): %s given. ' , getenv ( ' PHPSTAN_FNSR ' ) !== ' 0 ' && PHP_VERSION_ID >= 80100 ? ' string ' : ' ( \'bar \'| \'foo \') ' ) ,
991+ 'Parameter #2 $callback of function array_find expects callable(1|2, \'bar \'| \'foo \'): bool, Closure(int, string): ( \'bar \'| \'foo \') given. ' ,
992992 36 ,
993993 ],
994994 [
@@ -1014,7 +1014,7 @@ public function testArrayFindKeyCallback(): void
10141014 30 ,
10151015 ],
10161016 [
1017- sprintf ( 'Parameter #2 $callback of function array_find_key expects callable(1|2, \'bar \'| \'foo \'): bool, Closure(int, string): %s given. ' , getenv ( ' PHPSTAN_FNSR ' ) !== ' 0 ' && PHP_VERSION_ID >= 80100 ? ' string ' : ' ( \'bar \'| \'foo \') ' ) ,
1017+ 'Parameter #2 $callback of function array_find_key expects callable(1|2, \'bar \'| \'foo \'): bool, Closure(int, string): ( \'bar \'| \'foo \') given. ' ,
10181018 36 ,
10191019 ],
10201020 [
@@ -2567,6 +2567,14 @@ public function testBug11079(): void
25672567 $ this ->analyse ([__DIR__ . '/data/bug-11079.php ' ], []);
25682568 }
25692569
2570+ #[RequiresPhp('>= 8.1 ' )]
2571+ public function testBug10612 (): void
2572+ {
2573+ $ this ->checkExplicitMixed = true ;
2574+ $ this ->checkImplicitMixed = false ;
2575+ $ this ->analyse ([__DIR__ . '/data/bug-10612.php ' ], []);
2576+ }
2577+
25702578 #[RequiresPhp('>= 8.1 ' )]
25712579 public function testBug9652 (): void
25722580 {
0 commit comments