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_ukey() function : usage variation - Passing non-existing function..

Decoded Output download

*** Testing array_diff_ukey() : usage variation ***

Did this file decode correctly?

Original Code

--TEST--
Test array_diff_ukey() function : usage variation - Passing non-existing function name to callback
--FILE--
<?php
echo "*** Testing array_diff_ukey() : usage variation ***\n";

//Initialize variables
$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
$array2 = array("a" => "green", "yellow", "red");

//function name within double quotes
try {
    var_dump( array_diff_ukey($array1, $array1, "unknown_function") );
} catch (TypeError $e) {
    echo $e->getMessage(), "\n";
}

//function name within single quotes
try {
    var_dump( array_diff_ukey($array1, $array1, 'unknown_function') );
} catch (TypeError $e) {
    echo $e->getMessage(), "\n";
}

?>
--EXPECT--
*** Testing array_diff_ukey() : usage variation ***
array_diff_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name
array_diff_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name

Function Calls

None

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 cdc5c105840151af2445cda6912a3eee
Eval Count 0
Decode Time 99 ms