Skip to content

Commit

Permalink
Regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jul 24, 2022
1 parent 0a3824f commit fbdec4a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1133,4 +1133,12 @@ public function testBug7676(): void
$this->analyse([__DIR__ . '/data/bug-7676.php'], []);
}

public function testBug7138(): void
{
if (PHP_VERSION_ID < 80100) {
$this->markTestSkipped('Test requires PHP 8.1');
}
$this->analyse([__DIR__ . '/data/bug-7138.php'], []);
}

}
12 changes: 12 additions & 0 deletions tests/PHPStan/Rules/Functions/data/bug-7138.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Bug7138;

function test(): \PgSql\Result|false {
$connect = \pg_connect('');
if ($connect === false) {
return false;
}

return \pg_query($connect, '');
}

0 comments on commit fbdec4a

Please sign in to comment.