From: Ben Ramsey Date: Sat, 14 Apr 2012 07:39:25 +0000 (-0500) Subject: Simplify the code and use zend_hash_next_index_insert() X-Git-Tag: php-5.5.0beta1~3^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a27b890e6d643f17072e561a5d4f87211195a7c;p=php Simplify the code and use zend_hash_next_index_insert() --- diff --git a/ext/standard/array.c b/ext/standard/array.c index b707301bd8..c5d0fa7747 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2613,31 +2613,8 @@ PHP_FUNCTION(array_column) continue; } - switch (Z_TYPE_PP(zvalue)) { - case IS_NULL: - add_next_index_null(return_value); - break; - case IS_LONG: - add_next_index_long(return_value, Z_LVAL_PP(zvalue)); - break; - case IS_DOUBLE: - add_next_index_double(return_value, Z_DVAL_PP(zvalue)); - break; - case IS_BOOL: - add_next_index_bool(return_value, Z_BVAL_PP(zvalue)); - break; - case IS_OBJECT: - zval_add_ref(zvalue); - add_next_index_zval(return_value, *zvalue); - break; - case IS_STRING: - add_next_index_stringl(return_value, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue), 1); - break; - case IS_RESOURCE: - zval_add_ref(zvalue); - add_next_index_resource(return_value, Z_RESVAL_PP(zvalue)); - break; - } + Z_ADDREF_PP(zvalue); + zend_hash_next_index_insert(HASH_OF(return_value), (void **)zvalue, sizeof(zval *), NULL); } }