Skip to content

Commit

Permalink
test type inference with iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Oct 28, 2024
1 parent 9ebef40 commit 5f4b70f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/default/data/pdo-prepare.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,20 @@ public function specifiedArray(PDO $pdo, array $idsToUpdate, string $time)
assertType('PDOStatement<array{adaid: int<-32768, 32767>, 0: int<-32768, 32767>}>', $stmt);
}

/**
* @param iterable<int> $idsToUpdate
*/
public function specifiedIterable(PDO $pdo, iterable $idsToUpdate, string $time)
{
$query = 'SELECT adaid FROM ada WHERE adaid IN (:ids) AND email LIKE :time';
$stmt = $pdo->prepare($query);
$stmt->execute([
'ids' => $idsToUpdate,
'time' => $time,
]);
assertType('PDOStatement<array{adaid: int<-32768, 32767>, 0: int<-32768, 32767>}>', $stmt);
}

public function noInferenceOnBug196(PDO $pdo, array $minorPhpVersions, \DateTimeImmutable $updateDate)
{
$sumQueries = [];
Expand Down

0 comments on commit 5f4b70f

Please sign in to comment.