xref: /PHP-5.6/ext/pdo_dblib/tests/bug_54648.phpt (revision 53c036b3)
1--TEST--
2PDO_DBLIB: Does not force correct dateformat
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$db->query('set dateformat ymd');
12$rs = $db->query("select cast('1950-01-18 23:00:00' as smalldatetime) as sdt, cast('2030-01-01 23:59:59' as datetime) as dt");
13var_dump($rs->fetchAll(PDO::FETCH_ASSOC));
14echo "Done.\n";
15?>
16--EXPECT--
17array(1) {
18  [0]=>
19  array(2) {
20    ["sdt"]=>
21    string(19) "1950-01-18 23:00:00"
22    ["dt"]=>
23    string(19) "2030-01-01 23:59:59"
24  }
25}
26Done.
27