Annotation of embedaddon/php/ext/standard/tests/array/array_key_exists_variation4.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Test array_key_exists() function : usage variations - referenced variables
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: * Pass referenced variables as arguments to array_key_exists() to test behaviour
13: */
14:
15: echo "*** Testing array_key_exists() : usage variations ***\n";
16:
17: $array = array('one' => 1, 'two' => 2, 'three' => 3);
18:
19: echo "\n-- \$search is a reference to \$array --\n";
20: $search = &$array;
21: var_dump(array_key_exists('one', $search));
22:
23: echo "Done";
24: ?>
25:
26: --EXPECTF--
27: *** Testing array_key_exists() : usage variations ***
28:
29: -- $search is a reference to $array --
30: bool(true)
31: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>