#47370 [Bgs->Opn]: array_unique has backward compatibility problem, and SORT_REGULAR is confusing

From: Date: Sat, 14 Feb 2009 08:22:26 +0000
Subject: #47370 [Bgs->Opn]: array_unique has backward compatibility problem, and SORT_REGULAR is confusing
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-133825@lists.php.net to get a copy of this message
 ID:               47370
 Updated by:       moriyoshi@php.net
 Reported By:      for-bugs at hnw dot jp
-Status:           Bogus
+Status:           Open
 Bug Type:         Arrays related
 Operating System: any
 PHP Version:      5.2.9RC1
 New Comment:

This was not discussed, and thus no bogus thing.


Previous Comments:
------------------------------------------------------------------------

[2009-02-13 22:27:35] andrei@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

The slight BC breakage is negligible compared to the benefits of
getting it to work properly.

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

[2009-02-13 01:53:09] for-bugs at hnw dot jp

Thank you so much. The snapshot returns same result to PHP 5.2.8 with
reproduce code. Such as:

array(2) {
  [0]=>
  int(0)
  [1]=>
  string(0) ""
}
array(2) {
  [0]=>
  string(0) ""
  [1]=>
  string(1) "0"
}

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

[2009-02-12 18:58:34] moriyoshi@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/



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

[2009-02-12 18:12:35] moriyoshi@php.net

Verified with 5.2, 5.3, HEAD.


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

[2009-02-12 16:25:59] for-bugs at hnw dot jp

Sorry, reproduce code was incorrect. Correct code is below:

<?php
var_dump(array_unique(array(0,"","0")));
var_dump(array_unique(array("","0",0)));

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

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
    http://bugs.php.net/47370

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



Thread (12 messages)

« previous php.bugs (#133825) next »