forked from phpstan/phpstan-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbug-14206.php
More file actions
32 lines (27 loc) · 683 Bytes
/
bug-14206.php
File metadata and controls
32 lines (27 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php declare(strict_types = 1);
namespace Bug14206;
use PDO;
use PDOStatement;
class Test
{
public function test(PDO $db): void
{
/** @var PDOStatement<int,string> */
$statement = $db->prepare('SELECT foo FROM bar');
$statement->setFetchMode(PDO::FETCH_COLUMN, 0);
$statement->execute();
}
public function test2(PDO $db): void
{
/** @var PDOStatement<int,array<string>> */
$statement = $db->prepare('SELECT foo FROM bar');
$statement->execute();
}
public function test3(PDO $db): void
{
/** @var PDOStatement<int,object> */
$statement = $db->prepare('SELECT foo FROM bar');
$statement->setFetchMode(PDO::FETCH_OBJ, 0);
$statement->execute();
}
}