1--TEST-- 2PDO MySQL should use native types if ATTR_STRINGIFY_FETCHES is not enabled 3--EXTENSIONS-- 4pdo_mysql 5--SKIPIF-- 6<?php 7require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); 8MySQLPDOTest::skip(); 9if (!MySQLPDOTest::isPDOMySQLnd()) die('skip mysqlnd only'); 10?> 11--FILE-- 12<?php 13require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); 14 15$db = MySQLPDOTest::factory(); 16$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 17 18$db->exec('DROP TABLE IF EXISTS test'); 19$db->exec('CREATE TABLE test (i INT, f FLOAT)'); 20$db->exec('INSERT INTO test VALUES (42, 42.5)'); 21 22$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); 23var_dump($db->query('SELECT * FROM test')->fetchAll(PDO::FETCH_ASSOC)); 24 25$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); 26var_dump($db->query('SELECT * FROM test')->fetchAll(PDO::FETCH_ASSOC)); 27?> 28--CLEAN-- 29<?php 30require __DIR__ . '/mysql_pdo_test.inc'; 31MySQLPDOTest::dropTestTable(); 32?> 33--EXPECT-- 34array(1) { 35 [0]=> 36 array(2) { 37 ["i"]=> 38 int(42) 39 ["f"]=> 40 float(42.5) 41 } 42} 43array(1) { 44 [0]=> 45 array(2) { 46 ["i"]=> 47 int(42) 48 ["f"]=> 49 float(42.5) 50 } 51} 52