We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee52612 commit e67fb84Copy full SHA for e67fb84
tests/PHPStan/Analyser/nsrt/bug-8886.php
@@ -6,14 +6,13 @@
6
use function PHPStan\Testing\assertType;
7
8
function testPDOStatementGetIterator(): void {
9
- $pdo = new PDO('sqlite::memory:');
+ if (PHP_VERSION_ID < 80000) {
10
+ echo "Test skipped: PDOStatement::getIterator is only available in PHP 8 and above.";
11
+ return;
12
+ }
13
+
14
+ $pdo = new PDO('sqlite::memory:');
15
$stmt = $pdo->query('SELECT 1');
16
- if (PHP_VERSION_ID >= 80000) {
- // PHP 8 and above
- assertType('Iterator', $stmt->getIterator());
- } else {
- // Fallback for PHP 7.4
17
- assertType('Traversable', $stmt);
18
- }
+ assertType('Iterator', $stmt->getIterator());
19
}
0 commit comments