|  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
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.
Block user comment
Status: Assign to:
Bug Type:
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
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');
    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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-13 09:34 UTC]
-Status: Open +Status: Duplicate
 [2020-08-13 09:34 UTC]
Duplicate of bug #65208.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 14:01:29 2024 UTC