|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #26433 Request for is_unique()
Submitted: 2003-11-27 04:45 UTC Modified: 2016-06-14 12:32 UTC
Avg. Score:4.0 ± 1.0
Reproduced:0 of 1 (0.0%)
From: samtheman at tioga dot net Assigned: cmb (profile)
Status: Wont fix Package: Strings related
PHP Version: * OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: samtheman at tioga dot net
New email:
PHP Version: OS:


 [2003-11-27 04:45 UTC] samtheman at tioga dot net
Would like to see a function for comparing strings. is_unique() seems to be open.

Ability to compare more than 2 strings for uniqueness, if they are not unique false is returned, else true.

$choice1 = "yes";
$choice2 = "no";
$choice3 = "maybe";
$choice4 = "no";

   echo "yes";
   echo "no";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-30 03:31 UTC] samtheman2 at tioga dot net
function is_unique() {
  $numargs = func_num_args();
  $args = func_get_args();

  if(count(array_unique($args)) == $numargs) {
    return TRUE;
    return FALSE;
 [2010-11-18 23:24 UTC]
-Package: Feature/Change Request +Package: Strings related -Operating System: All +Operating System: * -PHP Version: Irrelevant +PHP Version: *
 [2014-03-05 20:55 UTC] narf at devilix dot net
Indeed ... a userland solution is easy enough to write.
 [2016-06-14 12:32 UTC]
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2016-06-14 12:32 UTC]
Considering the age of this request and the rather few votes in
favor, there obviously is not a widespread need for this
functionality, which can easily be implemented in userland anyway.
So I'm closing as won't fix.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Dec 05 06:01:23 2020 UTC