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.
PDOStatement::getIterator()
1 parent edfea32 commit ee52612Copy full SHA for ee52612
tests/PHPStan/Analyser/nsrt/bug-8886.php
@@ -8,5 +8,12 @@
8
function testPDOStatementGetIterator(): void {
9
$pdo = new PDO('sqlite::memory:');
10
$stmt = $pdo->query('SELECT 1');
11
- assertType('Iterator', $stmt->getIterator());
+
12
+ if (PHP_VERSION_ID >= 80000) {
13
+ // PHP 8 and above
14
+ assertType('Iterator', $stmt->getIterator());
15
+ } else {
16
+ // Fallback for PHP 7.4
17
+ assertType('Traversable', $stmt);
18
+ }
19
}
0 commit comments