1--TEST-- 2Bug #79106 (PDO may fetch wrong column indexes with PDO::FETCH_BOTH) 3--SKIPIF-- 4<?php 5if (!extension_loaded('pdo')) die('skip pdo extension not available'); 6$dir = getenv('REDIR_TEST_DIR'); 7if (!$dir) die('skip no driver'); 8require_once $dir . 'pdo_test.inc'; 9try { 10 $db = PDOTest::factory(); 11} catch (PDOException $e) { 12 die('skip ' . $e->getMessage()); 13} 14if (@$db->query('SELECT 1 as "1"') === false) { 15 die('skip driver does not support quoted numeric identifiers'); 16} 17?> 18--FILE-- 19<?php 20if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR=' . dirname(__FILE__) . '/../../pdo/tests/'); 21require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; 22$db = PDOTest::factory(); 23 24$stmt = $db->query('SELECT 0 as "2007", 0 as "2008", 0 as "2020"'); 25var_dump($stmt->fetchAll()); 26?> 27--EXPECT-- 28array(1) { 29 [0]=> 30 array(6) { 31 [2007]=> 32 string(1) "0" 33 [0]=> 34 string(1) "0" 35 [2008]=> 36 string(1) "0" 37 [1]=> 38 string(1) "0" 39 [2020]=> 40 string(1) "0" 41 [2]=> 42 string(1) "0" 43 } 44} 45