cvs: php4 /ext/standard array.c

From: Date: Thu, 05 Jun 2003 13:58:15 +0000
Subject: cvs: php4 /ext/standard array.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-21538@lists.php.net to get a copy of this message
sterling Thu Jun 5 09:58:15 2003 EDT Modified files: /php4/ext/standard array.c Log: fix array_key_exists() from HANDLE_NUMERIC() changes # need to go through this file and find any stuff that relies on this # change Index: php4/ext/standard/array.c diff -u php4/ext/standard/array.c:1.230 php4/ext/standard/array.c:1.231 --- php4/ext/standard/array.c:1.230 Tue May 20 14:18:56 2003 +++ php4/ext/standard/array.c Thu Jun 5 09:58:14 2003 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.230 2003/05/20 18:18:56 sterling Exp $ */ +/* $Id: array.c,v 1.231 2003/06/05 13:58:14 sterling Exp $ */ #include "php.h" #include "php_ini.h" @@ -3629,6 +3629,7 @@ { zval **key, /* key to check for */ **array; /* array to check in */ + long lvalue; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(ZEND_NUM_ARGS(), &key, &array) == FAILURE) { @@ -3642,11 +3643,14 @@ switch (Z_TYPE_PP(key)) { case IS_STRING: - if (zend_hash_exists(HASH_OF(*array), Z_STRVAL_PP(key), Z_STRLEN_PP(key)+1)) { + if (zend_is_numeric_key(*key, &lvalue)) { + if (zend_hash_index_exists(HASH_OF(*array), lvalue)) { + RETURN_TRUE; + } + } else if (zend_hash_exists(HASH_OF(*array), Z_STRVAL_PP(key), Z_STRLEN_PP(key)+1)) { RETURN_TRUE; } RETURN_FALSE; - case IS_LONG: if (zend_hash_index_exists(HASH_OF(*array), Z_LVAL_PP(key))) { RETURN_TRUE;

« previous php.cvs (#21538) next »