diff --git a/tests/default/data/pdo-stmt-obj-type.php b/tests/default/data/pdo-stmt-obj-type.php new file mode 100644 index 000000000..83025ed46 --- /dev/null +++ b/tests/default/data/pdo-stmt-obj-type.php @@ -0,0 +1,35 @@ +, 1: int<0, 4294967295>}> + */ + private function prepare(PDO $pdo): PDOStatement { + return $pdo->prepare('SELECT email, adaid FROM ada'); + } + + public function fetch(PDO $pdo) + { + $stmt = $this->prepare($pdo); + $stmt->execute(); + + assertType('PDOStatement, 1: int<0, 4294967295>}>', $stmt); + + $all = $stmt->fetch(PDO::FETCH_NUM); + assertType('array{string, int<0, 4294967295>}|false', $all); + + $all = $stmt->fetch(PDO::FETCH_ASSOC); + assertType('array{email: string, adaid: int<0, 4294967295>}|false', $all); + + $all = $stmt->fetch(PDO::FETCH_COLUMN); + assertType('string|false', $all); + } +}