From 5f4b70f20f2c089ca59701d4224a21b349d221a8 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 28 Oct 2024 12:05:33 +0100 Subject: [PATCH] test type inference with `iterable` --- tests/default/data/pdo-prepare.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/default/data/pdo-prepare.php b/tests/default/data/pdo-prepare.php index 1c674561..4ac808d0 100644 --- a/tests/default/data/pdo-prepare.php +++ b/tests/default/data/pdo-prepare.php @@ -136,6 +136,20 @@ public function specifiedArray(PDO $pdo, array $idsToUpdate, string $time) assertType('PDOStatement, 0: int<-32768, 32767>}>', $stmt); } + /** + * @param iterable $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, 0: int<-32768, 32767>}>', $stmt); + } + public function noInferenceOnBug196(PDO $pdo, array $minorPhpVersions, \DateTimeImmutable $updateDate) { $sumQueries = [];