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
 [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

Pull Requests

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: Sat Dec 21 16:01:28 2024 UTC