--TEST-- PDO Common: Bug #42917 (PDO::FETCH_KEY_PAIR doesn't work with setFetchMode) --EXTENSIONS-- pdo --SKIPIF-- --FILE-- exec("CREATE TABLE test42917 (a varchar(100), b varchar(100), c varchar(100))"); for ($i = 0; $i < 5; $i++) { $db->exec("INSERT INTO test42917 (a,b,c) VALUES('test".$i."','".$i."','".$i."')"); } $res = $db->query("SELECT a,b FROM test42917"); $res->setFetchMode(PDO::FETCH_KEY_PAIR); var_dump($res->fetchAll()); ?> --CLEAN-- --EXPECT-- array(5) { ["test0"]=> string(1) "0" ["test1"]=> string(1) "1" ["test2"]=> string(1) "2" ["test3"]=> string(1) "3" ["test4"]=> string(1) "4" }