Annotation of embedaddon/php/ext/standard/tests/array/array_key_exists_variation7.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test 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:
15: echo "*** Testing array_key_exists() : usage variations ***\n";
16:
17: $input = array ('one' => 'un', 'two' => 'deux', 'three' => 'trois');
18:
19: echo "\n-- Call array_key_exists() --\n";
20: var_dump($result = array_key_exists('one', $input));
21:
22: echo "\n-- Position of Internal Pointer in Original Array: --\n";
23: echo key($input) . " => " . current ($input) . "\n";
24:
25: echo "Done";
26: ?>
27:
28: --EXPECTF--
29: *** Testing array_key_exists() : usage variations ***
30:
31: -- Call array_key_exists() --
32: bool(true)
33:
34: -- Position of Internal Pointer in Original Array: --
35: one => un
36: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>