Skip to content

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

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

Closed
CViniciusSDias opened this issue Nov 15, 2023 · 0 comments · Fixed by #12683
Closed

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

CViniciusSDias opened this issue Nov 15, 2023 · 0 comments · Fixed by #12683

Comments

@CViniciusSDias
Copy link
Contributor

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

CViniciusSDias added a commit to CViniciusSDias/php-src that referenced this issue Nov 15, 2023
CViniciusSDias added a commit to CViniciusSDias/php-src that referenced this issue Nov 17, 2023
CViniciusSDias added a commit to CViniciusSDias/php-src that referenced this issue Nov 20, 2023
CViniciusSDias added a commit to CViniciusSDias/php-src that referenced this issue Nov 22, 2023
Girgias pushed a commit that referenced this issue Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant