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 (profile)
Status: Closed Package: PDO Firebird
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dorin dot marcoci at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC