php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #79890 array_unique does not allow strict comparison
Submitted: 2020-07-23 15:26 UTC Modified: 2020-08-13 09:34 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: michael dot vorisek at email dot cz Assigned:
Status: Duplicate Package: Scripting Engine problem
PHP Version: 7.4.8 OS: any
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: michael dot vorisek at email dot cz
New email:
PHP Version: OS:

 

 [2020-07-23 15:26 UTC] michael dot vorisek at email dot cz
Description:
------------
this should be definitely supported, probably with SORT_UNIQUE_STRICT constant.

currently, there is not simple way to remove same instance duplicates

Test script:
---------------
$d = new \DateTime('2000-1-1');
print_r(
    array_unique([$d, $d, new \DateTime('2000-1-1')], SORT_REGULAR)
);

Expected result:
----------------
array with 2 DateTime elements

Actual result:
--------------
remove same instance duplicates - not supported by array_unique

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-13 09:34 UTC] nikic@php.net
-Status: Open +Status: Duplicate
 [2020-08-13 09:34 UTC] nikic@php.net
Duplicate of bug #65208.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 28 04:01:23 2020 UTC