1--TEST-- 2Test 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 15echo "*** Testing array_key_exists() : usage variations ***\n"; 16 17$array = array('one' => 1, 'two' => 2, 'three' => 3); 18 19echo "\n-- \$search is a reference to \$array --\n"; 20$search = &$array; 21var_dump(array_key_exists('one', $search)); 22 23echo "Done"; 24?> 25 26--EXPECTF-- 27*** Testing array_key_exists() : usage variations *** 28 29-- $search is a reference to $array -- 30bool(true) 31Done 32