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_map() function : usage variations - non existent 'callback' function -..

Decoded Output download

*** Testing array_map() : non existent 'callback' function ***

Did this file decode correctly?

Original Code

--TEST--
Test array_map() function : usage variations - non existent 'callback' function
--FILE--
<?php
/*
 * Test array_map() by passing non existent function for $callback argument
 */

echo "*** Testing array_map() : non existent 'callback' function ***\n";

// arrays to be passed as arguments
$arr1 = array(1, 2);
$arr2 = array("one", "two");
$arr3 = array(1.1, 2.2);

try {
    var_dump( array_map('non_existent', $arr1, $arr2, $arr3) );
} catch (TypeError $e) {
    echo $e->getMessage(), "\n";
}

echo "Done";
?>
--EXPECT--
*** Testing array_map() : non existent 'callback' function ***
array_map(): Argument #1 ($callback) must be a valid callback or null, function "non_existent" not found or invalid function name
Done

Function Calls

None

Variables

$arr1 [{'key': 0, 'value': 1}, {'key': 1, 'value': 2}]
$arr2 [{'key': 0, 'value': 'one'}, {'key': 1, 'value': 'two'}]
$arr3 [{'key': 0, 'value': 1.1}, {'key': 1, 'value': 2.2}]

Stats

MD5 7805e6b8beb381fbdd56b1a741db367a
Eval Count 0
Decode Time 103 ms