Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Test array_unique() function : usage variations - array with duplicate keys --FIL..

Decoded Output download

*** Testing array_unique() : array with duplicate keys for \$input argument ***

Did this file decode correctly?

Original Code

--TEST--
Test array_unique() function : usage variations - array with duplicate keys
--FILE--
<?php
/*
 * Testing the functionality of array_unique() by passing
 * array having duplicate keys as values.
*/

echo "*** Testing array_unique() : array with duplicate keys for \$input argument ***\n";

// initialize the array having duplicate keys
$input = array( 1 => "one", 2 => "two", 2 => "2", 3 => "three", 1 => "1", "1", "2");
var_dump( array_unique($input) );

echo "Done";
?>
--EXPECT--
*** Testing array_unique() : array with duplicate keys for $input argument ***
array(3) {
  [1]=>
  string(1) "1"
  [2]=>
  string(1) "2"
  [3]=>
  string(5) "three"
}
Done

Function Calls

array_unique 1

Variables

$input [{'key': 1, 'value': 'one'}, {'key': 2, 'value': 'two'}, {'key': 2, 'value': '2'}, {'key': 3, 'value': 'three'}, {'key': 1, 'value': '1'}, {'key': 5, 'value': '1'}, {'key': 6, 'value': '2'}]

Stats

MD5 230e7d0d2d2c933dbb3dded1f5d43725
Eval Count 0
Decode Time 95 ms