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-- array_diff_uassoc(): Basic test --FILE-- <?php /* * array array_diff_uassoc ( arr..

Decoded Output download

--TEST--
array_diff_uassoc(): Basic test
--FILE--
<?php
/*
* array array_diff_uassoc ( array $array1, array $array2 [, array $..., callback $key_compare_func] )
* Function is implemented in ext/standard/array.c
*/
function key_compare_func($a, $b) {
    if ($a === $b) {
        return 0;
    }
    return ($a > $b) ? 1 : -1;
}
$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
$array2 = array("a" => "green", "yellow", "red");
$result = array_diff_uassoc($array1, $array2, "key_compare_func");
var_dump($result);
?>
--EXPECT--
array(3) {
  ["b"]=>
  string(5) "brown"
  ["c"]=>
  string(4) "blue"
  [0]=>
  string(3) "red"
}

Did this file decode correctly?

Original Code

--TEST--
array_diff_uassoc(): Basic test
--FILE--
<?php
/*
* array array_diff_uassoc ( array $array1, array $array2 [, array $..., callback $key_compare_func] )
* Function is implemented in ext/standard/array.c
*/
function key_compare_func($a, $b) {
    if ($a === $b) {
        return 0;
    }
    return ($a > $b) ? 1 : -1;
}
$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
$array2 = array("a" => "green", "yellow", "red");
$result = array_diff_uassoc($array1, $array2, "key_compare_func");
var_dump($result);
?>
--EXPECT--
array(3) {
  ["b"]=>
  string(5) "brown"
  ["c"]=>
  string(4) "blue"
  [0]=>
  string(3) "red"
}

Function Calls

array_diff_uassoc 1

Variables

$array1 [{'key': 'a', 'value': 'green'}, {'key': 'b', 'value': 'brown'}, {'key': 'c', 'value': 'blue'}, {'key': 3, 'value': 'red'}]
$array2 [{'key': 'a', 'value': 'green'}, {'key': 1, 'value': 'yellow'}, {'key': 2, 'value': 'red'}]

Stats

MD5 05bf72891ed10e10639012cd43e7ed1c
Eval Count 0
Decode Time 308 ms