xref: /PHP-7.4/ext/pdo_dblib/tests/bug_73396.phpt (revision 26dfce7f)
1--TEST--
2PDO_DBLIB: bigint columns are returned as strings
3--SKIPIF--
4<?php
5if (!extension_loaded('pdo_dblib')) die('skip not loaded');
6require __DIR__ . '/config.inc';
7?>
8--FILE--
9<?php
10require __DIR__ . '/config.inc';
11
12// on 64-bit machines, these columns should come back as ints
13// on 32-bit machines, they will come back as strings because zend_long isn't big enough
14$expected = PHP_INT_SIZE == 8 ? 1 : '1';
15
16$stmt = $db->query('SELECT CAST(1 AS bigint)');
17var_dump($stmt->fetchColumn() === $expected);
18?>
19--EXPECT--
20bool(true)
21