/* }}} */
-/* {{{ proto bool key_exists(mixed key, array search)
+/* {{{ proto bool array_key_exists(mixed key, array search)
Checks if the given key or index exists in the array */
-PHP_FUNCTION(key_exists)
+PHP_FUNCTION(array_key_exists)
{
zval **key, /* key to check for */
**array; /* array to check in */
-
+
if (ZEND_NUM_ARGS() != 2 ||
zend_get_parameters_ex(ZEND_NUM_ARGS(), &key, &array) == FAILURE) {
WRONG_PARAM_COUNT;
}
-
+
if (Z_TYPE_PP(array) != IS_ARRAY && Z_TYPE_PP(array) != IS_OBJECT) {
php_error(E_WARNING, "Wrong datatype for second argument in call to %s", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
php_error(E_WARNING, "Wrong datatype for first argument in call to %s", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
-
+
}
/* }}} */
PHP_FE(array_filter, NULL)
PHP_FE(array_map, NULL)
PHP_FE(array_chunk, NULL)
- PHP_FE(key_exists, NULL)
+ PHP_FE(array_key_exists, NULL)
/* aliases from array.c */
PHP_FALIAS(pos, current, first_arg_force_ref)
PHP_FUNCTION(array_sum);
PHP_FUNCTION(array_filter);
PHP_FUNCTION(array_map);
-PHP_FUNCTION(key_exists);
+PHP_FUNCTION(array_key_exists);
PHP_FUNCTION(array_chunk);
HashTable* php_splice(HashTable *, int, int, zval ***, int, HashTable **);