Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After php8.1, when PDO::ATTR_EMULATE_PREPARES is true and PDO::ATTR_STRINGIFY_FETCHES is true, decimal zeros are no longer filled. #2557

Closed
SakiTakamachi opened this issue Jul 4, 2023 · 2 comments

Comments

@SakiTakamachi
Copy link
Member

SakiTakamachi commented Jul 4, 2023

PDO::ATTR_EMULATE_PREPARES = true
PDO::ATTR_STRINGIFY_FETCHES = true

// DB value is 3.60, type is float

// php8.0
"3.60"

// php8.1
"3.6"

document
MySQL Driver

Integers and floats in result sets will now be returned using native PHP types instead of strings when using emulated prepared statements. This matches the behavior of native prepared statements. The previous behaviour can be restored by enabling the PDO::ATTR_STRINGIFY_FETCHES option.

I do not know if this is the intended change, but I believe that either the implementation or the documentation must be corrected, since at least the documentation is different from the actual situation.

What do you think?

I posted the same information in the php-src issue.
php/php-src#11587

@damianwadley
Copy link
Member

Just one bug report, please. They can always be moved later.

Or I guess now, if it's deemed a doc issue, then this can be reopened and the other closed.

@damianwadley damianwadley closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2023
@SakiTakamachi
Copy link
Member Author

OK, thank you for confirming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants