php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76674 Error message should be more detailed
Submitted: 2018-07-27 17:37 UTC Modified: 2018-08-20 00:38 UTC
Votes:2
Avg. Score:3.5 ± 1.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: teo8976 at gmail dot com Assigned: carusogabriel (profile)
Status: Closed Package: *General Issues
PHP Version: 7.3.0alpha4 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: teo8976 at gmail dot com
New email:
PHP Version: OS:

 

 [2018-07-27 17:37 UTC] teo8976 at gmail dot com
Description:
------------
EVERY TIME something is not what is expected to be, the error message should say both what it should have been, and what it was instead.

I f***ng hate when an error message gets so close to giving me the all the needed information, but it deliberately omits one tiny but crucial bit of detaildetail, that it would have cost nothing to include.


Test script:
---------------
$a=array(1,2,3);
$b='this is a string';

array_intersect($a, $b);

Expected result:
----------------
The error message should be something like:

"Warning: array_intersect(): Argument #2 should be an array, string given instead"

Actual result:
--------------
The error message is:

"Warning: array_intersect(): Argument #2 is not an array"

WHY DON'T YOU TELL ME WHAT THE F*** IT IS?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-07-27 20:00 UTC] danack@php.net
Please stop shouting and being generally unpleasant in your bug reports.
 [2018-08-05 00:53 UTC] carusogabriel@php.net
I've opened a PR in Github (https://github.com/php/php-src/pull/3429) for discussion, not only changing the message for `array_intersect` but for most of array_ functions.
 [2018-08-20 00:38 UTC] carusogabriel@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: carusogabriel
 [2018-08-20 00:38 UTC] carusogabriel@php.net
The previous mentioned PR was accepted and merged into PHP-7.3.

http://git.php.net/?p=php-src.git;a=commit;h=efbf846f
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 02:01:30 2024 UTC