From fcc6611de9054327441786e52444b5f8eecdd525 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 16 Feb 2013 19:13:36 +0100 Subject: Add support for non-scalar Iterator keys in foreach RFC: https://wiki.php.net/rfc/foreach-non-scalar-keys --- ext/intl/common/common_enum.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'ext/intl/common/common_enum.cpp') diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp index da47a437a6..3ba7855827 100644 --- a/ext/intl/common/common_enum.cpp +++ b/ext/intl/common/common_enum.cpp @@ -251,19 +251,7 @@ static PHP_METHOD(IntlIterator, key) INTLITERATOR_METHOD_FETCH_OBJECT; if (ii->iterator->funcs->get_current_key) { - char *str_key; - uint str_key_len; - ulong int_key; - - switch (ii->iterator->funcs->get_current_key( - ii->iterator, &str_key, &str_key_len, &int_key TSRMLS_CC)) { - case HASH_KEY_IS_LONG: - RETURN_LONG(int_key); - break; - case HASH_KEY_IS_STRING: - RETURN_STRINGL(str_key, str_key_len-1, 0); - break; - } + ii->iterator->funcs->get_current_key(ii->iterator, return_value TSRMLS_CC); } else { RETURN_LONG(ii->iterator->index); } -- cgit v1.2.1