Skip to content

Commit 8c00e55

Browse files
Add non regression test
1 parent 83f1509 commit 8c00e55

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,19 @@ public function testBug7684(): void
465465
$this->analyse([__DIR__ . '/data/bug-7684.php'], []);
466466
}
467467

468+
public function testBug4993(): void
469+
{
470+
$errors = [];
471+
if (PHP_VERSION_ID >= 80000) {
472+
$errors[] = [
473+
'Strict comparison using === between list<string|null> and null will always evaluate to false.',
474+
11,
475+
];
476+
}
477+
478+
$this->analyse([__DIR__ . '/data/bug-4993.php'], $errors);
479+
}
480+
468481
public function testBug6181(): void
469482
{
470483
$this->analyse([__DIR__ . '/data/bug-6181.php'], []);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug4993;
4+
5+
$inputHandle = fopen('php://stdin','r');
6+
if ($inputHandle === false)
7+
{
8+
exit(1);
9+
}
10+
$row = fgetcsv( $inputHandle );
11+
if ( $row === false || $row === NULL )
12+
{
13+
exit(1);
14+
}

0 commit comments

Comments
 (0)