Skip to content

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

Closed
@SakiTakamachi

Description

@SakiTakamachi

Description

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

// DB value is 3.60, type is float

// php8.0
"3.60"

// after 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 document issue.
php/doc-en#2557

PHP Version

PHP 8.2.7

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions