1--TEST--
2Test array_key_exists() function : usage variations - position of internal array pointer
3--FILE--
4<?php
5/* Prototype  : bool array_key_exists(mixed $key, array $search)
6 * Description: Checks if the given key or index exists in the array
7 * Source code: ext/standard/array.c
8 * Alias to functions: key_exists
9 */
10
11/*
12 * Check the position of the internal array pointer after calling array_key_exists()
13 */
14
15echo "*** Testing array_key_exists() : usage variations ***\n";
16
17$input = array ('one' => 'un', 'two' => 'deux', 'three' => 'trois');
18
19echo "\n-- Call array_key_exists() --\n";
20var_dump($result = array_key_exists('one', $input));
21
22echo "\n-- Position of Internal Pointer in Original Array: --\n";
23echo key($input) . " => " . current ($input) . "\n";
24
25echo "Done";
26?>
27--EXPECTF--
28*** Testing array_key_exists() : usage variations ***
29
30-- Call array_key_exists() --
31bool(true)
32
33-- Position of Internal Pointer in Original Array: --
34one => un
35Done
36