Skip to content

Incorrect error message when passing null to join/implode's array parameter #12682

Closed
@CViniciusSDias

Description

@CViniciusSDias

Description

The following code:

<?php
try {
    join('', null);
} catch (TypeError $e) {
    echo $e->getMessage();
}
?>

Resulted in this output:

join(): Argument #1 ($pieces) must be of type array, string given

But I expected this output instead:

join(): Argument #2 ($array) must be of type array, null given

PHP Version

PHP 8.2.10

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