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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 15:01:29 2024 UTC