rfc:list_assoc_unique

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:list_assoc_unique [2022/12/01 17:58] ilutovrfc:list_assoc_unique [2022/12/01 18:19] (current) – Move to under discussion ilutov
Line 2: Line 2:
   * Date: 2022-12-01   * Date: 2022-12-01
   * Author: Ilija Tovilo <ilutov@php.net>   * Author: Ilija Tovilo <ilutov@php.net>
-  * Status: Draft+  * Status: Under discussion
   * Proposed Version: PHP 8.3   * Proposed Version: PHP 8.3
   * Implementation: https://github.com/php/php-src/pull/9882   * Implementation: https://github.com/php/php-src/pull/9882
Line 41: Line 41:
 Removing duplicates from arrays is a common use case provided by many programming languages. PHPs <php>array_unique()</php> Removing duplicates from arrays is a common use case provided by many programming languages. PHPs <php>array_unique()</php>
 has been there for [[https://github.com/php/php-src/commit/99f151f1bde0483944767cf0ed49d3270f61d326|~23 years]]. has been there for [[https://github.com/php/php-src/commit/99f151f1bde0483944767cf0ed49d3270f61d326|~23 years]].
-However, PHP has multiple definitions of equality, four in particular supported by <php>array_unique</php>:+However, PHP has multiple definitions of equality, four in particular supported by <php>array_unique()</php>:
  
   * <php>SORT_STRING</php> - Converts values to strings and compares with <php><</php>/<php>==</php>/<php>></php>   * <php>SORT_STRING</php> - Converts values to strings and compares with <php><</php>/<php>==</php>/<php>></php>
Line 78: Line 78:
  
 Previously, adding a new <php>ARRAY_UNIQUE_IDENTICAL</php> constant that can be passed to <php>array_unique()</php>s <php>$flag</php> Previously, adding a new <php>ARRAY_UNIQUE_IDENTICAL</php> constant that can be passed to <php>array_unique()</php>s <php>$flag</php>
-parameter was discussed. The discussion has revealed that most people would prefer a new function over extending the existing function+parameter was discussed. The discussion has revealed that most people would prefer a new function over extending <php>array_unique()</php>
 with a flag that might be more difficult to discover. with a flag that might be more difficult to discover.
  
rfc/list_assoc_unique.1669917516.txt.gz · Last modified: 2022/12/01 17:58 by ilutov