Annotation of embedaddon/php/ext/standard/tests/array/array_key_exists_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test array_key_exists() function : basic functionality
! 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: * Test basic functionality of array_key_exists()
! 13: */
! 14:
! 15: echo "*** Testing array_key_exists() : basic functionality ***\n";
! 16:
! 17: $key1 = 'key';
! 18: $key2 = 'val';
! 19: $search = array('one', 'key' => 'value', 'val');
! 20: var_dump(array_key_exists($key1, $search));
! 21: var_dump(array_key_exists($key2, $search));
! 22:
! 23: echo "Done";
! 24: ?>
! 25: --EXPECTF--
! 26: *** Testing array_key_exists() : basic functionality ***
! 27: bool(true)
! 28: bool(false)
! 29: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>