Req #26433 [Opn->Wfx]: Request for is_unique()

From: Date: Tue, 14 Jun 2016 12:32:27 +0000
Subject: Req #26433 [Opn->Wfx]: Request for is_unique()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201603@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=26433&edit=1

 ID:                 26433
 Updated by:         cmb@php.net
 Reported by:        samtheman at tioga dot net
 Summary:            Request for is_unique()
-Status:             Open
+Status:             Wont fix
 Type:               Feature/Change Request
 Package:            Strings related
 Operating System:   *
 PHP Version:        *
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[2014-03-05 20:55:01] narf at devilix dot net

Indeed ... a userland solution is easy enough to write.
-1

------------------------------------------------------------------------
[2003-11-30 03:31:56] samtheman2 at tioga dot net

function is_unique() {
  $numargs = func_num_args();
  $args = func_get_args();

  if(count(array_unique($args)) == $numargs) {
    return TRUE;
  }else{
    return FALSE;
  }

------------------------------------------------------------------------
[2003-11-27 04:45:03] samtheman at tioga dot net

Description:
------------
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";

if(is_unique($choice1,$choice2,$choice3,$choice4)){
   echo "yes";
}else{
   echo "no";
}



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



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


Thread (4 messages)

« previous php.bugs (#201603) next »