Req #79890 [NEW]: array_unique does not allow strict comparison
From: michael dot vorisek at email dot cz
Operating system: any
PHP version: 7.4.8
Package: Scripting Engine problem
Bug Type: Feature/Change Request
Bug description:array_unique does not allow strict comparison
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
--
Edit bug report at https://bugs.php.net/bug.php?id=79890&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79890&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79890&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79890&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79890&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79890&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79890&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79890&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79890&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79890&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79890&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79890&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79890&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79890&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79890&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79890&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79890&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79890&r=mysqlcfg
Thread (2 messages)
- michael dot vorisek at email dot cz