php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #72583 All data are fetched as strings
Submitted: 2016-07-12 09:05 UTC Modified: 2017-01-06 17:47 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: dorin dot marcoci at gmail dot com Assigned: ab
Status: Closed Package: PDO Firebird
PHP Version: Irrelevant OS:
Private report: No CVE-ID:
 [2016-07-12 09:05 UTC] dorin dot marcoci at gmail dot com
Description:
------------
All columns are fetched as strings, even numeric, bools, etc...
Numeric columns (integers, floats) should be returned as native values.

In MySQL ND package this works as expected.
Please fix this for Firebird too.

Thanks!

Expected result:
----------------
Correct types

Actual result:
--------------
Incorrect types

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-13 01:28 UTC] kalle@php.net
-Type: Bug +Type: Feature/Change Request
 [2016-07-13 01:28 UTC] kalle@php.net
Changing this to be a FR;

Big side note here, every database driver seems to do this very differently and there is not much consistency across the board, even in PDO where I believe we had an option or similar to do so (or maybe it was just MySQL, I can't remember for certain).

But all in all, it would be nice to do this for all database drivers, or at least those that are in the core now with the increased typeness in PHP.
 [2016-07-13 01:28 UTC] kalle@php.net
-Status: Open +Status: Verified
 [2017-01-06 02:04 UTC] spam2 at rhsoft dot net
oh yeah!

please the same for mysqli / pdo-mysql so that strict-typing becomes really useable because currently you need to to (int)$row['id'] when you pass the value to function(int $id)
 [2017-01-06 02:06 UTC] spam2 at rhsoft dot net
see also https://bugs.php.net/bug.php?id=73650
 [2017-01-06 17:47 UTC] ab@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: ab
 [2017-01-06 17:47 UTC] ab@php.net
PR https://github.com/php/php-src/pull/2279 is merged.

Thanks.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC