diff --git a/tests/TypeReconciliation/EmptyTest.php b/tests/TypeReconciliation/EmptyTest.php index 628d13b3652..c7991804454 100644 --- a/tests/TypeReconciliation/EmptyTest.php +++ b/tests/TypeReconciliation/EmptyTest.php @@ -506,6 +506,112 @@ function nonEmptyString(string $str): string { ', 'assertions' => ['$arr===' => 'list'], ], + 'issue-9205-1' => [ + 'code' => <<<'PHP' + [ + '$lastLabel===' => 'string', + ], + ], + 'issue-9205-2' => [ + 'code' => <<<'PHP' + 0) { + exit; + } + PHP, + 'assertions' => [ + '$x===' => 'string', // perhaps this should be improved in future + ], + ], + 'issue-9205-3' => [ + 'code' => <<<'PHP' + [ + '$x===' => 'string', // can't be improved really + ], + ], + 'issue-9205-4' => [ + 'code' => <<<'PHP' + [ + '$x===' => 'string', // can be improved + ], + ], + 'issue-9349' => [ + 'code' => <<<'PHP' + [ + '$str===' => 'non-falsy-string', // can't be improved + ], + ], + 'issue-9349-2' => [ + 'code' => <<<'PHP' + [ + 'code' => <<<'PHP' + [ + '$a===' => 'string', // can't be improved + ], + ], + 'issue-9341-1' => [ + 'code' => <<<'PHP' + 2) + { + exit; + } + PHP, + 'assertions' => [ + '$GLOBALS[\'sql_query\']===' => 'string', + ], + ], ]; }