Skip to content

Migration to PHP 8.3 confusion regarding array_sum / array_product behavior #4659

@DanielRuf

Description

@DanielRuf

I stumbled upon this PR during a migration to PHP 8.3:

array_sum() and array_product() now warn when values in the array cannot be converted to int/float.

This seems to be not the case. As we can see at https://3v4l.org/lKNfW#v8.3.20, the value (string) 3Hallo is converted to 3. So either the warning Warning: A non-numeric value encountered in or the documentation is not right.

Since cannot be converted to int/float. is not the case here, does this mean the documentation is inaccurate?

Originally posted by @DanielRuf in #3106 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions