Req #78855 [Com]: Native PHP types in database fetches
| From: | imbolk at gmail dot com | Date: | Fri, 22 Nov 2019 13:07:32 +0000 |
| Subject: | Req #78855 [Com]: Native PHP types in database fetches | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223858@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78855&edit=1
ID: 78855
Comment by: imbolk at gmail dot com
Reported by: olegxx at gmail dot com
Summary: Native PHP types in database fetches
Status: Open
Type: Feature/Change Request
Package: PostgreSQL related
Operating System: Linux
PHP Version: 7.2.25
Block user comment: N
Private report: N
New Comment:
> and how is that relevant when it's about a global connection option versus add params to
> each and every single command which needs massive rewrite in existing userland code to use it?
Because the global option will also affect this function too. It is absolutely unclear how it should
work in this case.
Previous Comments:
------------------------------------------------------------------------
[2019-11-22 12:51:59] fgfgfgfdf at somewhere dot com
> We can add extension wide (php.ini) option to change
> behavior of all fetch functions
you can't, no RFC introducing ini options which change language behavior that way will pass in
2019
> also we can add fourth param to pg_fetch_result to return
> error in it for example
or you can refrain from half thougth solutions and write a proper RFC which get discussed, no way
that any change in that context will go into 7.2/7.3/7.4 anyways
------------------------------------------------------------------------
[2019-11-22 12:47:32] olegxx at gmail dot com
We can add extension wide (php.ini) option to change behavior of all fetch functions, also we can
add fourth param to pg_fetch_result to return error in it for example.
------------------------------------------------------------------------
[2019-11-22 12:28:39] fgfgfgfdf at somewhere dot com
> MySQL does not have a Boolean type, and Postgres does
and how is that relevant when it's about a global connection option versus add params to each
and every single command which needs massive rewrite in existing userland code to use it?
------------------------------------------------------------------------
[2019-11-22 12:27:49] olegxx at gmail dot com
PostgreSQL have bool type:
$res = pg_query($db, "SELECT false");
var_dump(pg_fetch_result($res, 0));
This code should print "bool(false)" in native types mode but
"FALSE is returned if row exceeds the number of rows in the set, or on any other error."
------------------------------------------------------------------------
[2019-11-22 12:24:49] imbolk at gmail dot com
MySQL does not have a Boolean type, and Postgres does.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=78855
--
Edit this bug report at https://bugs.php.net/bug.php?id=78855&edit=1