xref: /PHP-7.2/ext/pdo_dblib/tests/bug_71667.phpt (revision 8db64e91)
1--TEST--
2PDO_DBLIB: Emulate how mssql extension names "computed" columns
3--SKIPIF--
4<?php
5if (!extension_loaded('pdo_dblib')) die('skip not loaded');
6require dirname(__FILE__) . '/config.inc';
7?>
8--FILE--
9<?php
10require dirname(__FILE__) . '/config.inc';
11
12$stmt = $db->prepare("SELECT 1, 2 AS named, 3");
13$stmt->execute();
14var_dump($stmt->fetchAll());
15
16?>
17--EXPECT--
18array(1) {
19  [0]=>
20  array(6) {
21    ["computed"]=>
22    int(1)
23    [0]=>
24    int(1)
25    ["named"]=>
26    int(2)
27    [1]=>
28    int(2)
29    ["computed1"]=>
30    int(3)
31    [2]=>
32    int(3)
33  }
34}
35