Bug #62977 [Asn->Csd]: array_unique() misbehaves with array of DateTimes

From: Date: Sat, 13 Oct 2018 06:20:38 +0000
Subject: Bug #62977 [Asn->Csd]: array_unique() misbehaves with array of DateTimes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217543@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62977&edit=1

 ID:                 62977
 Updated by:         jhdxr@php.net
 Reported by:        ladislav at marek dot su
 Summary:            array_unique() misbehaves with array of DateTimes
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Date/time related
 Operating System:   Linux
 PHP Version:        5.4Git-2012-08-30 (Git)
-Assigned To:        laruence
+Assigned To:        jhdxr
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php




Previous Comments:
------------------------------------------------------------------------
[2018-03-12 12:29:04] cmb@php.net

It seems to me that this has been fixed as of PHP 7.0.0, see
<https://3v4l.org/rf96r>.

------------------------------------------------------------------------
[2012-08-31 04:08:33] laruence@php.net

fixing this we should introduce a new sorting function for objects

which will make the nearest objects be neighbourings after sorting,  leaving the 
comparing to the unique phase.

but the problem is how to implement "the nearest" (equal > same ce > not equal)

------------------------------------------------------------------------
[2012-08-31 03:41:56] laruence@php.net

Cataphrac, that's why I didn't commit it, and the reason is because the comparable 
calss are not neighbouring after sorting.

that's not much thing to do with the compare handler of specific handler.

thanks

------------------------------------------------------------------------
[2012-08-30 17:27:44] cataphract@php.net

laruuence: The patch is very strange. Why are making all the elements of the same class being
compared equal? Objects can be compared. Perhaps you should fix the DateTime's
compare_objects() object handler.

------------------------------------------------------------------------
[2012-08-30 15:52:05] laruence@php.net

The following patch has been added/updated:

Patch Name: bug62977.patch
Revision:   1346341925
URL:        https://bugs.php.net/patch-display.php?bug=62977&patch=bug62977.patch&revision=1346341925

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=62977


--
Edit this bug report at https://bugs.php.net/bug.php?id=62977&edit=1


Thread (7 messages)

« previous php.bugs (#217543) next »