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_diff_uassoc() function : usage variation - Passing boolean indexed arr..

Decoded Output download

*** Testing array_diff_uassoc() : usage variation ***

Did this file decode correctly?

Original Code

--TEST--
Test array_diff_uassoc() function : usage variation - Passing boolean indexed array
--FILE--
<?php
echo "*** Testing array_diff_uassoc() : usage variation ***\n";

// Initialise function arguments not being substituted (if any)
$input_array = array(0 => '0', 1 => '1', -10 => '-10', 'true' => 1, 'false' => 0);
$boolean_indx_array = array(true => 'boolt', false => 'boolf', TRUE => 'boolT', FALSE => 'boolF');

echo "\n-- Testing array_diff_key() function with float indexed array --\n";
var_dump( array_diff_uassoc($input_array, $boolean_indx_array, "strcasecmp") );
var_dump( array_diff_uassoc($boolean_indx_array, $input_array, "strcasecmp") );

?>
--EXPECT--
*** Testing array_diff_uassoc() : usage variation ***

-- Testing array_diff_key() function with float indexed array --
array(5) {
  [0]=>
  string(1) "0"
  [1]=>
  string(1) "1"
  [-10]=>
  string(3) "-10"
  ["true"]=>
  int(1)
  ["false"]=>
  int(0)
}
array(2) {
  [1]=>
  string(5) "boolT"
  [0]=>
  string(5) "boolF"
}

Function Calls

None

Variables

$input_array [{'key': 0, 'value': '0'}, {'key': 1, 'value': '1'}, {'key': -10, 'value': '-10'}, {'key': 'true', 'value': 1}, {'key': 'false', 'value': 0}]

Stats

MD5 66ca2745e6fcbc4ccc2272fee2b21f88
Eval Count 0
Decode Time 98 ms