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_key_exists() function : usage variations - position of internal array ..

Decoded Output download

*** Testing array_key_exists() : usage variations ***

-- Call array_key_exists() --

Did this file decode correctly?

Original Code

--TEST--
Test array_key_exists() function : usage variations - position of internal array pointer
--FILE--
<?php
/*
 * Check the position of the internal array pointer after calling array_key_exists()
 */

echo "*** Testing array_key_exists() : usage variations ***\n";

$input = array ('one' => 'un', 'two' => 'deux', 'three' => 'trois');

echo "\n-- Call array_key_exists() --\n";
var_dump($result = array_key_exists('one', $input));

echo "\n-- Position of Internal Pointer in Original Array: --\n";
echo key($input) . " => " . current ($input) . "\n";

echo "Done";
?>
--EXPECT--
*** Testing array_key_exists() : usage variations ***

-- Call array_key_exists() --
bool(true)

-- Position of Internal Pointer in Original Array: --
one => un
Done

Function Calls

array_key_exists 1

Variables

$input [{'key': 'one', 'value': 'un'}, {'key': 'two', 'value': 'deux'}, {'key': 'three', 'value': 'trois'}]

Stats

MD5 84e3e5cf2981695d41e4d72d59493086
Eval Count 0
Decode Time 87 ms