php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72201 The doc of the callback param of array_udiff_assoc is inaccurate
Submitted: 2016-05-11 17:54 UTC Modified: 2020-12-28 15:42 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: eran dot kornblau at kaltura dot com Assigned: cmb (profile)
Status: Wont fix Package: Arrays related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: eran dot kornblau at kaltura dot com
New email:
PHP Version: OS:

 

 [2016-05-11 17:54 UTC] eran dot kornblau at kaltura dot com
Description:
------------
Looking at the code, this function only cares whether the callback returns zero or nonzero, it does not care whether the value is negative or positive like the docs say. This makes sense because this function does not involve any ordering, only comparison of elements


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-28 17:43 UTC] cmb@php.net
-Package: Documentation problem +Package: Arrays related
 [2018-10-02 21:35 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2018-10-02 21:35 UTC] cmb@php.net
Same for array_udiff(), array_udiff_uassoc(), array_uintersect(),
array_uintersect_assoc() and array_uintersect_uassoc().
 [2020-12-28 15:42 UTC] cmb@php.net
-Status: Verified +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2020-12-28 15:42 UTC] cmb@php.net
Disregard my comment above.  Actually, the functions which
*currently* do not care about anything than (in)equality to zero
are: array_diff_key(), array_diff_assoc(), array_udiff_assoc(),
array_intersect_key(), array_intersect_assoc() and
array_uintersect_assoc().

However, at least in theory the implementation of these functions
may change in the future so they use some kind of ordering, so
changing the docs could introduce forward compatibility issues.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 12:01:27 2024 UTC