summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2013-03-14 14:19:41 +0400
committerDmitry Stogov <dmitry@zend.com>2013-03-14 14:19:41 +0400
commitdd1c358d1bf8fd492e39d46f93878d47a3b6d257 (patch)
tree5c8923188500c17d085a289a0c70f610f521b9cb
parentd77c865aff794826f6286c078268db6a005fea33 (diff)
parentc09652c2899dd4149fe3187b5b50f6b3c54da384 (diff)
downloadphp-git-dd1c358d1bf8fd492e39d46f93878d47a3b6d257.tar.gz
Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src: fix the fix fix for bug #63530 mysqlnd_stmt::bind_one_parameter uses wrong alloc for stmt->param_bind Forgot to remove some now unused variables Add support for non-scalar Iterator keys in foreach fixed headers order - Updated to version 2013.2 (2013b) fixed the test Fixed bug #64370 (microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT']) Disable zend_always_inline in debug build
-rw-r--r--NEWS5
-rwxr-xr-xUPGRADING2
-rw-r--r--UPGRADING.INTERNALS8
-rw-r--r--Zend/tests/generators/generator_with_nonscalar_keys.phpt52
-rw-r--r--Zend/zend.h7
-rw-r--r--Zend/zend_API.c34
-rw-r--r--Zend/zend_API.h2
-rw-r--r--Zend/zend_generators.c24
-rw-r--r--Zend/zend_hash.c18
-rw-r--r--Zend/zend_hash.h4
-rw-r--r--Zend/zend_interfaces.c38
-rw-r--r--Zend/zend_interfaces.h2
-rw-r--r--Zend/zend_iterators.h7
-rw-r--r--Zend/zend_types.h1
-rw-r--r--Zend/zend_vm_def.h70
-rw-r--r--Zend/zend_vm_execute.h70
-rw-r--r--ext/com_dotnet/com_iterator.c9
-rw-r--r--ext/com_dotnet/com_saproxy.c9
-rw-r--r--ext/date/lib/timezonedb.h1209
-rw-r--r--ext/date/php_date.c7
-rw-r--r--ext/dom/dom_iterators.c27
-rw-r--r--ext/intl/breakiterator/breakiterator_iterators.cpp10
-rw-r--r--ext/intl/common/common_enum.cpp14
-rw-r--r--ext/intl/resourcebundle/resourcebundle_iterator.c13
-rw-r--r--ext/mysqli/mysqli_result_iterator.c5
-rw-r--r--ext/mysqlnd/mysqlnd_ps.c2
-rw-r--r--ext/pdo/pdo_stmt.c9
-rw-r--r--ext/pdo_mysql/mysql_statement.c20
-rw-r--r--ext/phar/phar_object.c50
-rw-r--r--ext/simplexml/simplexml.c27
-rw-r--r--ext/soap/php_encoding.c19
-rw-r--r--ext/spl/spl_array.c24
-rw-r--r--ext/spl/spl_directory.c20
-rw-r--r--ext/spl/spl_dllist.c5
-rw-r--r--ext/spl/spl_fixedarray.c8
-rw-r--r--ext/spl/spl_heap.c5
-rw-r--r--ext/spl/spl_iterators.c171
-rw-r--r--ext/spl/spl_iterators.h5
-rw-r--r--ext/spl/tests/iterator_to_array_nonscalar_keys.phpt31
-rw-r--r--ext/spl/tests/multiple_iterator_001.phpt20
-rw-r--r--ext/standard/array.c74
-rw-r--r--ext/standard/tests/bug64370_var1.phpt21
-rw-r--r--ext/standard/tests/bug64370_var2.phpt23
-rw-r--r--win32/globals.c2
-rw-r--r--win32/php_win32_globals.h4
-rw-r--r--win32/time.c133
46 files changed, 1098 insertions, 1222 deletions
diff --git a/NEWS b/NEWS
index 4ef3a55bc1..9d87b9592f 100644
--- a/NEWS
+++ b/NEWS
@@ -8,7 +8,12 @@ PHP NEWS
. Added support for changing the process's title in CLI/CLI-Server SAPIs.
The implementation is more robust that the proctitle PECL module. More
details here: https://wiki.php.net/rfc/cli_process_title. (Keyur)
+ . Fixed bug #64370 (microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT']).
+ (Anatol)
+- mysqlnd
+ . Fixed bug #63530 (mysqlnd_stmt::bind_one_parameter crashes, uses wrong alloc
+ for stmt->param_bind). (Andrey)
07 Mar 2013, PHP 5.5.0 Alpha 6
diff --git a/UPGRADING b/UPGRADING
index 76d6f4fb83..ca35a99cd8 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -81,6 +81,8 @@ PHP 5.5 UPGRADE NOTES
a string constant. (https://wiki.php.net/rfc/class_name_scalars)
- Support for changing the process's title in CLI/CLI-Server SAPIs. (Keyur)
(https://wiki.php.net/rfc/cli_process_title)
+- Added support for non-scalar Iterator keys in foreach.
+ (https://wiki.php.net/rfc/foreach-non-scalar-keys).
========================================
2. Changes in SAPI modules
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index 44cdfaee6c..56243d1f81 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -64,6 +64,14 @@ void zend_qsort_r(void *base, size_t nmemb, size_t siz, compare_r_func_t compare
The extra argument it has (relatively to zend_qsort()) is passed to the
comparison function.
+ d. get_current_key
+
+The signature of the get_current_key iteration handler has been changed to:
+
+void (*get_current_key)(zend_object_iterator *iter, zval *key TSRMLS_DC);
+
+The key should be written into the zval* using the ZVAL_* macros.
+
========================
2. Build system changes
========================
diff --git a/Zend/tests/generators/generator_with_nonscalar_keys.phpt b/Zend/tests/generators/generator_with_nonscalar_keys.phpt
new file mode 100644
index 0000000000..5ae55a1be0
--- /dev/null
+++ b/Zend/tests/generators/generator_with_nonscalar_keys.phpt
@@ -0,0 +1,52 @@
+--TEST--
+Generators can return non-scalar keys
+--FILE--
+<?php
+
+function gen() {
+ yield [1, 2, 3] => [4, 5, 6];
+ yield (object) ['a' => 'b'] => (object) ['b' => 'a'];
+ yield 3.14 => 2.73;
+ yield false => true;
+ yield true => false;
+ yield null => null;
+}
+
+foreach (gen() as $k => $v) {
+ var_dump($k, $v);
+}
+
+?>
+--EXPECT--
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+array(3) {
+ [0]=>
+ int(4)
+ [1]=>
+ int(5)
+ [2]=>
+ int(6)
+}
+object(stdClass)#3 (1) {
+ ["a"]=>
+ string(1) "b"
+}
+object(stdClass)#4 (1) {
+ ["b"]=>
+ string(1) "a"
+}
+float(3.14)
+float(2.73)
+bool(false)
+bool(true)
+bool(true)
+bool(false)
+NULL
+NULL
diff --git a/Zend/zend.h b/Zend/zend.h
index aed03d8715..36554637ef 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -299,7 +299,6 @@ void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((nore
/*
* zval
*/
-typedef struct _zval_struct zval;
typedef struct _zend_class_entry zend_class_entry;
typedef struct _zend_guard {
@@ -365,6 +364,10 @@ struct _zval_struct {
#define Z_UNSET_ISREF(z) Z_UNSET_ISREF_P(&(z))
#define Z_SET_ISREF_TO(z, isref) Z_SET_ISREF_TO_P(&(z), isref)
+#if ZEND_DEBUG
+#define zend_always_inline inline
+#define zend_never_inline
+#else
#if defined(__GNUC__)
#if __GNUC__ >= 3
#define zend_always_inline inline __attribute__((always_inline))
@@ -373,7 +376,6 @@ struct _zval_struct {
#define zend_always_inline inline
#define zend_never_inline
#endif
-
#elif defined(_MSC_VER)
#define zend_always_inline __forceinline
#define zend_never_inline
@@ -381,6 +383,7 @@ struct _zval_struct {
#define zend_always_inline inline
#define zend_never_inline
#endif
+#endif /* ZEND_DEBUG */
#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
# define EXPECTED(condition) __builtin_expect(condition, 1)
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 95c90ea753..2653d0849a 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1502,6 +1502,40 @@ ZEND_API int add_get_index_stringl(zval *arg, ulong index, const char *str, uint
}
/* }}} */
+ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value) /* {{{ */
+{
+ int result;
+
+ switch (Z_TYPE_P(key)) {
+ case IS_STRING:
+ result = zend_symtable_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &value, sizeof(zval *), NULL);
+ break;
+ case IS_NULL:
+ result = zend_symtable_update(ht, "", 1, &value, sizeof(zval *), NULL);
+ break;
+ case IS_RESOURCE:
+ zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_LVAL_P(key), Z_LVAL_P(key));
+ /* break missing intentionally */
+ case IS_BOOL:
+ case IS_LONG:
+ result = zend_hash_index_update(ht, Z_LVAL_P(key), &value, sizeof(zval *), NULL);
+ break;
+ case IS_DOUBLE:
+ result = zend_hash_index_update(ht, zend_dval_to_lval(Z_LVAL_P(key)), &value, sizeof(zval *), NULL);
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type");
+ result = FAILURE;
+ }
+
+ if (result == SUCCESS) {
+ Z_ADDREF_P(value);
+ }
+
+ return result;
+}
+/* }}} */
+
ZEND_API int add_property_long_ex(zval *arg, const char *key, uint key_len, long n TSRMLS_DC) /* {{{ */
{
zval *tmp;
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index fb642c1475..c26141b183 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -426,6 +426,8 @@ ZEND_API int add_get_index_double(zval *arg, ulong idx, double d, void **dest);
ZEND_API int add_get_index_string(zval *arg, ulong idx, const char *str, void **dest, int duplicate);
ZEND_API int add_get_index_stringl(zval *arg, ulong idx, const char *str, uint length, void **dest, int duplicate);
+ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value);
+
ZEND_API int add_property_long_ex(zval *arg, const char *key, uint key_len, long l TSRMLS_DC);
ZEND_API int add_property_null_ex(zval *arg, const char *key, uint key_len TSRMLS_DC);
ZEND_API int add_property_bool_ex(zval *arg, const char *key, uint key_len, int b TSRMLS_DC);
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index c1dbee124f..3f43552f1f 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -755,31 +755,17 @@ static void zend_generator_iterator_get_data(zend_object_iterator *iterator, zva
}
/* }}} */
-static int zend_generator_iterator_get_key(zend_object_iterator *iterator, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) /* {{{ */
+static void zend_generator_iterator_get_key(zend_object_iterator *iterator, zval *key TSRMLS_DC) /* {{{ */
{
zend_generator *generator = (zend_generator *) iterator->data;
zend_generator_ensure_initialized(generator TSRMLS_CC);
- if (!generator->key) {
- return HASH_KEY_NON_EXISTANT;
- }
-
- if (Z_TYPE_P(generator->key) == IS_LONG) {
- *int_key = Z_LVAL_P(generator->key);
- return HASH_KEY_IS_LONG;
- }
-
- if (Z_TYPE_P(generator->key) == IS_STRING) {
- *str_key = estrndup(Z_STRVAL_P(generator->key), Z_STRLEN_P(generator->key));
- *str_key_len = Z_STRLEN_P(generator->key) + 1;
- return HASH_KEY_IS_STRING;
+ if (generator->key) {
+ ZVAL_ZVAL(key, generator->key, 1, 0);
+ } else {
+ ZVAL_NULL(key);
}
-
- /* Waiting for Etienne's patch to allow arbitrary zval keys. Until then
- * error out on non-int and non-string keys. */
- zend_error_noreturn(E_ERROR, "Currently only int and string keys can be yielded");
- return HASH_KEY_NON_EXISTANT; /* Nerver reached */
}
/* }}} */
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index 0609d707f5..bca47b330f 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -1171,6 +1171,24 @@ ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index,
return HASH_KEY_NON_EXISTANT;
}
+ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos) {
+ Bucket *p;
+
+ IS_CONSISTENT(ht);
+
+ p = pos ? (*pos) : ht->pInternalPointer;
+
+ if (!p) {
+ Z_TYPE_P(key) = IS_NULL;
+ } else if (p->nKeyLength) {
+ Z_TYPE_P(key) = IS_STRING;
+ Z_STRVAL_P(key) = IS_INTERNED(p->arKey) ? (char *) p->arKey : estrndup(p->arKey, p->nKeyLength - 1);
+ Z_STRLEN_P(key) = p->nKeyLength - 1;
+ } else {
+ Z_TYPE_P(key) = IS_LONG;
+ Z_LVAL_P(key) = p->h;
+ }
+}
ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos)
{
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index 88c3bfb421..a0c147f397 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -170,13 +170,13 @@ ZEND_API int zend_hash_quick_exists(const HashTable *ht, const char *arKey, uint
ZEND_API int zend_hash_index_exists(const HashTable *ht, ulong h);
ZEND_API ulong zend_hash_next_free_element(const HashTable *ht);
-
/* traversing */
#define zend_hash_has_more_elements_ex(ht, pos) \
(zend_hash_get_current_key_type_ex(ht, pos) == HASH_KEY_NON_EXISTANT ? FAILURE : SUCCESS)
ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index, uint *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos);
+ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosition *pos);
ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos);
@@ -199,6 +199,8 @@ ZEND_API int zend_hash_set_pointer(HashTable *ht, const HashPointer *ptr);
zend_hash_move_backwards_ex(ht, NULL)
#define zend_hash_get_current_key(ht, str_index, num_index, duplicate) \
zend_hash_get_current_key_ex(ht, str_index, NULL, num_index, duplicate, NULL)
+#define zend_hash_get_current_key_zval(ht, key) \
+ zend_hash_get_current_key_zval_ex(ht, key, NULL)
#define zend_hash_get_current_key_type(ht) \
zend_hash_get_current_key_type_ex(ht, NULL)
#define zend_hash_get_current_data(ht, pData) \
diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c
index e2e81ed326..16751549b4 100644
--- a/Zend/zend_interfaces.c
+++ b/Zend/zend_interfaces.c
@@ -195,7 +195,7 @@ static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, cha
/* }}} */
/* {{{ zend_user_it_get_current_key */
-ZEND_API int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
+ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key TSRMLS_DC)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = (zval*)iter->it.data;
@@ -203,42 +203,16 @@ ZEND_API int zend_user_it_get_current_key(zend_object_iterator *_iter, char **st
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_key, "key", &retval);
- if (!retval) {
- *int_key = 0;
- if (!EG(exception))
- {
+ if (retval) {
+ ZVAL_ZVAL(key, retval, 1, 1);
+ } else {
+ if (!EG(exception)) {
zend_error(E_WARNING, "Nothing returned from %s::key()", iter->ce->name);
}
- return HASH_KEY_IS_LONG;
- }
- switch (Z_TYPE_P(retval)) {
- default:
- zend_error(E_WARNING, "Illegal type returned from %s::key()", iter->ce->name);
- case IS_NULL:
- *int_key = 0;
- zval_ptr_dtor(&retval);
- return HASH_KEY_IS_LONG;
-
- case IS_STRING:
- *str_key = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
- *str_key_len = Z_STRLEN_P(retval)+1;
- zval_ptr_dtor(&retval);
- return HASH_KEY_IS_STRING;
-
- case IS_DOUBLE:
- *int_key = (long)Z_DVAL_P(retval);
- zval_ptr_dtor(&retval);
- return HASH_KEY_IS_LONG;
- case IS_RESOURCE:
- case IS_BOOL:
- case IS_LONG:
- *int_key = (long)Z_LVAL_P(retval);
- zval_ptr_dtor(&retval);
- return HASH_KEY_IS_LONG;
+ ZVAL_LONG(key, 0);
}
}
-/* }}} */
/* {{{ zend_user_it_move_forward */
ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC)
diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h
index 23547951ed..ba4bc6ccb6 100644
--- a/Zend/zend_interfaces.h
+++ b/Zend/zend_interfaces.h
@@ -51,7 +51,7 @@ ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend
ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC);
ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC);
-ZEND_API int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
+ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key TSRMLS_DC);
ZEND_API void zend_user_it_get_current_data(zend_object_iterator *_iter, zval ***data TSRMLS_DC);
ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC);
ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC);
diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h
index b484102b20..f74068a271 100644
--- a/Zend/zend_iterators.h
+++ b/Zend/zend_iterators.h
@@ -38,8 +38,11 @@ typedef struct _zend_object_iterator_funcs {
/* fetch the item data for the current element */
void (*get_current_data)(zend_object_iterator *iter, zval ***data TSRMLS_DC);
- /* fetch the key for the current element (return HASH_KEY_IS_STRING or HASH_KEY_IS_LONG) (optional, may be NULL) */
- int (*get_current_key)(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
+ /* fetch the key for the current element (optional, may be NULL). The key
+ * should be written into the provided zval* using the ZVAL_* macros. If
+ * this handler is not provided auto-incrementing integer keys will be
+ * used. */
+ void (*get_current_key)(zend_object_iterator *iter, zval *key TSRMLS_DC);
/* step forwards to next element */
void (*move_forward)(zend_object_iterator *iter TSRMLS_DC);
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index 3e68add3dc..9cdf31fb34 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -52,6 +52,7 @@ typedef unsigned long zend_uintptr_t;
typedef unsigned int zend_object_handle;
typedef struct _zend_object_handlers zend_object_handlers;
+typedef struct _zval_struct zval;
typedef struct _zend_object_value {
zend_object_handle handle;
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index b7445c9662..206a2333fe 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -4231,13 +4231,13 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
zend_free_op free_op1;
zval *array = EX_T(opline->op1.var).fe.ptr;
zval **value;
- char *str_key;
- uint str_key_len;
- ulong int_key;
HashTable *fe_ht;
zend_object_iterator *iter = NULL;
- int key_type = 0;
- zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY);
+
+ zval *key = NULL;
+ if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
+ key = &EX_T((opline+1)->result.var).tmp_var;
+ }
SAVE_OPLINE();
@@ -4248,8 +4248,11 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
case ZEND_ITER_PLAIN_OBJECT: {
- const char *class_name, *prop_name;
zend_object *zobj = zend_objects_get_address(array TSRMLS_CC);
+ int key_type;
+ char *str_key;
+ zend_uint str_key_len;
+ zend_ulong int_key;
fe_ht = Z_OBJPROP_P(array);
zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
@@ -4261,15 +4264,23 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
zend_hash_move_forward(fe_ht);
- } while (key_type == HASH_KEY_NON_EXISTANT ||
- (key_type != HASH_KEY_IS_LONG &&
- zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS));
- zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
- if (use_key && key_type != HASH_KEY_IS_LONG) {
- zend_unmangle_property_name_ex(str_key, str_key_len-1, &class_name, &prop_name, &str_key_len);
- str_key = estrndup(prop_name, str_key_len);
- str_key_len++;
+ } while (key_type != HASH_KEY_IS_LONG &&
+ zend_check_property_access(zobj, str_key, str_key_len - 1 TSRMLS_CC) != SUCCESS);
+
+ if (key) {
+ if (key_type == HASH_KEY_IS_LONG) {
+ ZVAL_LONG(key, int_key);
+ } else {
+ const char *class_name, *prop_name;
+ int prop_name_len;
+ zend_unmangle_property_name_ex(
+ str_key, str_key_len - 1, &class_name, &prop_name, &prop_name_len
+ );
+ ZVAL_STRINGL(key, prop_name, prop_name_len, 1);
+ }
}
+
+ zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
break;
}
@@ -4280,8 +4291,8 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
/* reached end of iteration */
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
- if (use_key) {
- key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL);
+ if (key) {
+ zend_hash_get_current_key_zval(fe_ht, key);
}
zend_hash_move_forward(fe_ht);
zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
@@ -4316,16 +4327,15 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
/* failure in get_current_data */
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
- if (use_key) {
+ if (key) {
if (iter->funcs->get_current_key) {
- key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, key TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&array);
HANDLE_EXCEPTION();
}
} else {
- key_type = HASH_KEY_IS_LONG;
- int_key = iter->index;
+ ZVAL_LONG(key, iter->index);
}
}
break;
@@ -4341,26 +4351,6 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
AI_SET_PTR(&EX_T(opline->result.var), *value);
}
- if (use_key) {
- zval *key = &EX_T((opline+1)->result.var).tmp_var;
-
- switch (key_type) {
- case HASH_KEY_IS_STRING:
- Z_STRVAL_P(key) = (char*)str_key;
- Z_STRLEN_P(key) = str_key_len-1;
- Z_TYPE_P(key) = IS_STRING;
- break;
- case HASH_KEY_IS_LONG:
- Z_LVAL_P(key) = int_key;
- Z_TYPE_P(key) = IS_LONG;
- break;
- default:
- case HASH_KEY_NON_EXISTANT:
- ZVAL_NULL(key);
- break;
- }
- }
-
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
ZEND_VM_NEXT_OPCODE();
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index ddbc39d68d..d65dfc41f2 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -13546,13 +13546,13 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval *array = EX_T(opline->op1.var).fe.ptr;
zval **value;
- char *str_key;
- uint str_key_len;
- ulong int_key;
HashTable *fe_ht;
zend_object_iterator *iter = NULL;
- int key_type = 0;
- zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY);
+
+ zval *key = NULL;
+ if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
+ key = &EX_T((opline+1)->result.var).tmp_var;
+ }
SAVE_OPLINE();
@@ -13563,8 +13563,11 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
case ZEND_ITER_PLAIN_OBJECT: {
- const char *class_name, *prop_name;
zend_object *zobj = zend_objects_get_address(array TSRMLS_CC);
+ int key_type;
+ char *str_key;
+ zend_uint str_key_len;
+ zend_ulong int_key;
fe_ht = Z_OBJPROP_P(array);
zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
@@ -13576,15 +13579,23 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
zend_hash_move_forward(fe_ht);
- } while (key_type == HASH_KEY_NON_EXISTANT ||
- (key_type != HASH_KEY_IS_LONG &&
- zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS));
- zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
- if (use_key && key_type != HASH_KEY_IS_LONG) {
- zend_unmangle_property_name_ex(str_key, str_key_len-1, &class_name, &prop_name, &str_key_len);
- str_key = estrndup(prop_name, str_key_len);
- str_key_len++;
+ } while (key_type != HASH_KEY_IS_LONG &&
+ zend_check_property_access(zobj, str_key, str_key_len - 1 TSRMLS_CC) != SUCCESS);
+
+ if (key) {
+ if (key_type == HASH_KEY_IS_LONG) {
+ ZVAL_LONG(key, int_key);
+ } else {
+ const char *class_name, *prop_name;
+ int prop_name_len;
+ zend_unmangle_property_name_ex(
+ str_key, str_key_len - 1, &class_name, &prop_name, &prop_name_len
+ );
+ ZVAL_STRINGL(key, prop_name, prop_name_len, 1);
+ }
}
+
+ zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
break;
}
@@ -13595,8 +13606,8 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
/* reached end of iteration */
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
- if (use_key) {
- key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL);
+ if (key) {
+ zend_hash_get_current_key_zval(fe_ht, key);
}
zend_hash_move_forward(fe_ht);
zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
@@ -13631,16 +13642,15 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
/* failure in get_current_data */
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
- if (use_key) {
+ if (key) {
if (iter->funcs->get_current_key) {
- key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, key TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&array);
HANDLE_EXCEPTION();
}
} else {
- key_type = HASH_KEY_IS_LONG;
- int_key = iter->index;
+ ZVAL_LONG(key, iter->index);
}
}
break;
@@ -13656,26 +13666,6 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
AI_SET_PTR(&EX_T(opline->result.var), *value);
}
- if (use_key) {
- zval *key = &EX_T((opline+1)->result.var).tmp_var;
-
- switch (key_type) {
- case HASH_KEY_IS_STRING:
- Z_STRVAL_P(key) = (char*)str_key;
- Z_STRLEN_P(key) = str_key_len-1;
- Z_TYPE_P(key) = IS_STRING;
- break;
- case HASH_KEY_IS_LONG:
- Z_LVAL_P(key) = int_key;
- Z_TYPE_P(key) = IS_LONG;
- break;
- default:
- case HASH_KEY_NON_EXISTANT:
- ZVAL_NULL(key);
- break;
- }
- }
-
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
ZEND_VM_NEXT_OPCODE();
diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c
index ce4bdd67c0..ecf395b161 100644
--- a/ext/com_dotnet/com_iterator.c
+++ b/ext/com_dotnet/com_iterator.c
@@ -74,16 +74,15 @@ static void com_iter_get_data(zend_object_iterator *iter, zval ***data TSRMLS_DC
*data = &I->zdata;
}
-static int com_iter_get_key(zend_object_iterator *iter, char **str_key, uint *str_key_len,
- ulong *int_key TSRMLS_DC)
+static void com_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
struct php_com_iterator *I = (struct php_com_iterator*)iter->data;
if (I->key == (ulong)-1) {
- return HASH_KEY_NON_EXISTANT;
+ ZVAL_NULL(key);
+ } else {
+ ZVAL_LONG(key, I->key);
}
- *int_key = I->key;
- return HASH_KEY_IS_LONG;
}
static int com_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c
index ad92849743..5450370cd9 100644
--- a/ext/com_dotnet/com_saproxy.c
+++ b/ext/com_dotnet/com_saproxy.c
@@ -519,16 +519,15 @@ static void saproxy_iter_get_data(zend_object_iterator *iter, zval ***data TSRML
*data = ptr_ptr;
}
-static int saproxy_iter_get_key(zend_object_iterator *iter, char **str_key, uint *str_key_len,
- ulong *int_key TSRMLS_DC)
+static void saproxy_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
php_com_saproxy_iter *I = (php_com_saproxy_iter*)iter->data;
if (I->key == -1) {
- return HASH_KEY_NON_EXISTANT;
+ ZVAL_NULL(key);
+ } else {
+ ZVAL_LONG(key, I->key);
}
- *int_key = (ulong)I->key;
- return HASH_KEY_IS_LONG;
}
static int saproxy_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h
index ba34c75b20..7bf9a9d220 100644
--- a/ext/date/lib/timezonedb.h
+++ b/ext/date/lib/timezonedb.h
@@ -14,573 +14,573 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[579] = {
{ "Africa/Bujumbura" , 0x000571 },
{ "Africa/Cairo" , 0x0005B5 },
{ "Africa/Casablanca" , 0x000878 },
- { "Africa/Ceuta" , 0x000A76 },
- { "Africa/Conakry" , 0x000D7D },
- { "Africa/Dakar" , 0x000DE8 },
- { "Africa/Dar_es_Salaam" , 0x000E4E },
- { "Africa/Djibouti" , 0x000EBB },
- { "Africa/Douala" , 0x000F10 },
- { "Africa/El_Aaiun" , 0x000F65 },
- { "Africa/Freetown" , 0x000FCB },
- { "Africa/Gaborone" , 0x0010DA },
- { "Africa/Harare" , 0x001147 },
- { "Africa/Johannesburg" , 0x00119C },
- { "Africa/Juba" , 0x00120A },
- { "Africa/Kampala" , 0x00131D },
- { "Africa/Khartoum" , 0x00139C },
- { "Africa/Kigali" , 0x0014AF },
- { "Africa/Kinshasa" , 0x001504 },
- { "Africa/Lagos" , 0x00155F },
- { "Africa/Libreville" , 0x0015B4 },
- { "Africa/Lome" , 0x001609 },
- { "Africa/Luanda" , 0x00164D },
- { "Africa/Lubumbashi" , 0x0016A2 },
- { "Africa/Lusaka" , 0x0016FD },
- { "Africa/Malabo" , 0x001752 },
- { "Africa/Maputo" , 0x0017B8 },
- { "Africa/Maseru" , 0x00180D },
- { "Africa/Mbabane" , 0x001875 },
- { "Africa/Mogadishu" , 0x0018CB },
- { "Africa/Monrovia" , 0x001926 },
- { "Africa/Nairobi" , 0x00198C },
- { "Africa/Ndjamena" , 0x001A0B },
- { "Africa/Niamey" , 0x001A77 },
- { "Africa/Nouakchott" , 0x001AEA },
- { "Africa/Ouagadougou" , 0x001B55 },
- { "Africa/Porto-Novo" , 0x001BAA },
- { "Africa/Sao_Tome" , 0x001C10 },
- { "Africa/Timbuktu" , 0x001C65 },
- { "Africa/Tripoli" , 0x001CD0 },
- { "Africa/Tunis" , 0x001EC9 },
- { "Africa/Windhoek" , 0x001FDB },
- { "America/Adak" , 0x002222 },
- { "America/Anchorage" , 0x002598 },
- { "America/Anguilla" , 0x00290C },
- { "America/Antigua" , 0x002961 },
- { "America/Araguaina" , 0x0029C7 },
- { "America/Argentina/Buenos_Aires" , 0x002C21 },
- { "America/Argentina/Catamarca" , 0x002DCF },
- { "America/Argentina/ComodRivadavia" , 0x002F90 },
- { "America/Argentina/Cordoba" , 0x003136 },
- { "America/Argentina/Jujuy" , 0x00330B },
- { "America/Argentina/La_Rioja" , 0x0034BF },
- { "America/Argentina/Mendoza" , 0x003677 },
- { "America/Argentina/Rio_Gallegos" , 0x003837 },
- { "America/Argentina/Salta" , 0x0039EC },
- { "America/Argentina/San_Juan" , 0x003B98 },
- { "America/Argentina/San_Luis" , 0x003D50 },
- { "America/Argentina/Tucuman" , 0x003F16 },
- { "America/Argentina/Ushuaia" , 0x0040D2 },
- { "America/Aruba" , 0x00428D },
- { "America/Asuncion" , 0x0042F3 },
- { "America/Atikokan" , 0x0045D8 },
- { "America/Atka" , 0x0046AE },
- { "America/Bahia" , 0x004A14 },
- { "America/Bahia_Banderas" , 0x004BA7 },
- { "America/Barbados" , 0x004E20 },
- { "America/Belem" , 0x004EBA },
- { "America/Belize" , 0x004FB5 },
- { "America/Blanc-Sablon" , 0x005131 },
- { "America/Boa_Vista" , 0x0051E5 },
- { "America/Bogota" , 0x0052EE },
- { "America/Boise" , 0x00535A },
- { "America/Buenos_Aires" , 0x0056F1 },
- { "America/Cambridge_Bay" , 0x00588A },
- { "America/Campo_Grande" , 0x005BB2 },
- { "America/Cancun" , 0x005EA1 },
- { "America/Caracas" , 0x0060E3 },
- { "America/Catamarca" , 0x00614A },
- { "America/Cayenne" , 0x0062F0 },
- { "America/Cayman" , 0x006352 },
- { "America/Chicago" , 0x0063A7 },
- { "America/Chihuahua" , 0x0068BE },
- { "America/Coral_Harbour" , 0x006B29 },
- { "America/Cordoba" , 0x006BBB },
- { "America/Costa_Rica" , 0x006D61 },
- { "America/Creston" , 0x006DEB },
- { "America/Cuiaba" , 0x006E77 },
- { "America/Curacao" , 0x007155 },
- { "America/Danmarkshavn" , 0x0071BB },
- { "America/Dawson" , 0x0072FF },
- { "America/Dawson_Creek" , 0x00761C },
- { "America/Denver" , 0x0077F6 },
- { "America/Detroit" , 0x007B7C },
- { "America/Dominica" , 0x007EDB },
- { "America/Edmonton" , 0x007F30 },
- { "America/Eirunepe" , 0x0082E8 },
- { "America/El_Salvador" , 0x0083FB },
- { "America/Ensenada" , 0x008470 },
- { "America/Fort_Wayne" , 0x008917 },
- { "America/Fortaleza" , 0x0087D9 },
- { "America/Glace_Bay" , 0x008B81 },
- { "America/Godthab" , 0x008EF8 },
- { "America/Goose_Bay" , 0x0091BC },
- { "America/Grand_Turk" , 0x009679 },
- { "America/Grenada" , 0x009928 },
- { "America/Guadeloupe" , 0x00997D },
- { "America/Guatemala" , 0x0099D2 },
- { "America/Guayaquil" , 0x009A5B },
- { "America/Guyana" , 0x009AB8 },
- { "America/Halifax" , 0x009B39 },
- { "America/Havana" , 0x00A04F },
- { "America/Hermosillo" , 0x00A3C2 },
- { "America/Indiana/Indianapolis" , 0x00A4A0 },
- { "America/Indiana/Knox" , 0x00A731 },
- { "America/Indiana/Marengo" , 0x00AAC8 },
- { "America/Indiana/Petersburg" , 0x00AD6E },
- { "America/Indiana/Tell_City" , 0x00B2BB },
- { "America/Indiana/Vevay" , 0x00B554 },
- { "America/Indiana/Vincennes" , 0x00B78F },
- { "America/Indiana/Winamac" , 0x00BA43 },
- { "America/Indianapolis" , 0x00B051 },
- { "America/Inuvik" , 0x00BCFC },
- { "America/Iqaluit" , 0x00BFF3 },
- { "America/Jamaica" , 0x00C315 },
- { "America/Jujuy" , 0x00C3DA },
- { "America/Juneau" , 0x00C584 },
- { "America/Kentucky/Louisville" , 0x00C902 },
- { "America/Kentucky/Monticello" , 0x00CD20 },
- { "America/Knox_IN" , 0x00D0A5 },
- { "America/Kralendijk" , 0x00D416 },
- { "America/La_Paz" , 0x00D47C },
- { "America/Lima" , 0x00D4E3 },
- { "America/Los_Angeles" , 0x00D58B },
- { "America/Louisville" , 0x00D99C },
- { "America/Lower_Princes" , 0x00DD91 },
- { "America/Maceio" , 0x00DDF7 },
- { "America/Managua" , 0x00DF31 },
- { "America/Manaus" , 0x00DFE4 },
- { "America/Marigot" , 0x00E0E6 },
- { "America/Martinique" , 0x00E13B },
- { "America/Matamoros" , 0x00E1A7 },
- { "America/Mazatlan" , 0x00E400 },
- { "America/Mendoza" , 0x00E66D },
- { "America/Menominee" , 0x00E821 },
- { "America/Merida" , 0x00EBA2 },
- { "America/Metlakatla" , 0x00EDDD },
- { "America/Mexico_City" , 0x00EF17 },
- { "America/Miquelon" , 0x00F192 },
- { "America/Moncton" , 0x00F404 },
- { "America/Monterrey" , 0x00F89B },
- { "America/Montevideo" , 0x00FAFE },
- { "America/Montreal" , 0x00FE10 },
- { "America/Montserrat" , 0x010326 },
- { "America/Nassau" , 0x01037B },
- { "America/New_York" , 0x0106C0 },
- { "America/Nipigon" , 0x010BCB },
- { "America/Nome" , 0x010F1C },
- { "America/Noronha" , 0x01129A },
- { "America/North_Dakota/Beulah" , 0x0113CA },
- { "America/North_Dakota/Center" , 0x01175E },
- { "America/North_Dakota/New_Salem" , 0x011AF2 },
- { "America/Ojinaga" , 0x011E9B },
- { "America/Panama" , 0x0120FC },
- { "America/Pangnirtung" , 0x012151 },
- { "America/Paramaribo" , 0x012487 },
- { "America/Phoenix" , 0x012519 },
- { "America/Port-au-Prince" , 0x0125C7 },
- { "America/Port_of_Spain" , 0x0127EC },
- { "America/Porto_Acre" , 0x0126ED },
- { "America/Porto_Velho" , 0x012841 },
- { "America/Puerto_Rico" , 0x012937 },
- { "America/Rainy_River" , 0x0129A2 },
- { "America/Rankin_Inlet" , 0x012CDA },
- { "America/Recife" , 0x012FC0 },
- { "America/Regina" , 0x0130EA },
- { "America/Resolute" , 0x0132A8 },
- { "America/Rio_Branco" , 0x013599 },
- { "America/Rosario" , 0x01369C },
- { "America/Santa_Isabel" , 0x013842 },
- { "America/Santarem" , 0x013BE5 },
- { "America/Santiago" , 0x013CEA },
- { "America/Santo_Domingo" , 0x014093 },
- { "America/Sao_Paulo" , 0x014159 },
- { "America/Scoresbysund" , 0x014468 },
- { "America/Shiprock" , 0x014756 },
- { "America/Sitka" , 0x014AE5 },
- { "America/St_Barthelemy" , 0x014E6D },
- { "America/St_Johns" , 0x014EC2 },
- { "America/St_Kitts" , 0x015415 },
- { "America/St_Lucia" , 0x01546A },
- { "America/St_Thomas" , 0x0154BF },
- { "America/St_Vincent" , 0x015514 },
- { "America/Swift_Current" , 0x015569 },
- { "America/Tegucigalpa" , 0x01568A },
- { "America/Thule" , 0x015709 },
- { "America/Thunder_Bay" , 0x015950 },
- { "America/Tijuana" , 0x015C99 },
- { "America/Toronto" , 0x016032 },
- { "America/Tortola" , 0x016549 },
- { "America/Vancouver" , 0x01659E },
- { "America/Virgin" , 0x0169DB },
- { "America/Whitehorse" , 0x016A30 },
- { "America/Winnipeg" , 0x016D4D },
- { "America/Yakutat" , 0x01718D },
- { "America/Yellowknife" , 0x0174F8 },
- { "Antarctica/Casey" , 0x017808 },
- { "Antarctica/Davis" , 0x0178A5 },
- { "Antarctica/DumontDUrville" , 0x017946 },
- { "Antarctica/Macquarie" , 0x0179D8 },
- { "Antarctica/Mawson" , 0x017C52 },
- { "Antarctica/McMurdo" , 0x017CCE },
- { "Antarctica/Palmer" , 0x017FD0 },
- { "Antarctica/Rothera" , 0x0182EC },
- { "Antarctica/South_Pole" , 0x018362 },
- { "Antarctica/Syowa" , 0x01866A },
- { "Antarctica/Vostok" , 0x0186D8 },
- { "Arctic/Longyearbyen" , 0x018749 },
- { "Asia/Aden" , 0x018A7B },
- { "Asia/Almaty" , 0x018AD0 },
- { "Asia/Amman" , 0x018C4F },
- { "Asia/Anadyr" , 0x018F05 },
- { "Asia/Aqtau" , 0x0190EA },
- { "Asia/Aqtobe" , 0x0192E9 },
- { "Asia/Ashgabat" , 0x0194A1 },
- { "Asia/Ashkhabad" , 0x0195BE },
- { "Asia/Baghdad" , 0x0196DB },
- { "Asia/Bahrain" , 0x019850 },
- { "Asia/Baku" , 0x0198B6 },
- { "Asia/Bangkok" , 0x019B9E },
- { "Asia/Beirut" , 0x019BF3 },
- { "Asia/Bishkek" , 0x019F00 },
- { "Asia/Brunei" , 0x01A0AC },
- { "Asia/Calcutta" , 0x01A10E },
- { "Asia/Choibalsan" , 0x01A187 },
- { "Asia/Chongqing" , 0x01A300 },
- { "Asia/Chungking" , 0x01A3EF },
- { "Asia/Colombo" , 0x01A49E },
- { "Asia/Dacca" , 0x01A53A },
- { "Asia/Damascus" , 0x01A5E0 },
- { "Asia/Dhaka" , 0x01A930 },
- { "Asia/Dili" , 0x01A9D6 },
- { "Asia/Dubai" , 0x01AA5F },
- { "Asia/Dushanbe" , 0x01AAB4 },
- { "Asia/Gaza" , 0x01ABB7 },
- { "Asia/Harbin" , 0x01AE10 },
- { "Asia/Hebron" , 0x01AEF7 },
- { "Asia/Ho_Chi_Minh" , 0x01B159 },
- { "Asia/Hong_Kong" , 0x01B1D1 },
- { "Asia/Hovd" , 0x01B393 },
- { "Asia/Irkutsk" , 0x01B50B },
- { "Asia/Istanbul" , 0x01B6F1 },
- { "Asia/Jakarta" , 0x01BADE },
- { "Asia/Jayapura" , 0x01BB88 },
- { "Asia/Jerusalem" , 0x01BC24 },
- { "Asia/Kabul" , 0x01BF53 },
- { "Asia/Kamchatka" , 0x01BFA4 },
- { "Asia/Karachi" , 0x01C180 },
- { "Asia/Kashgar" , 0x01C235 },
- { "Asia/Kathmandu" , 0x01C306 },
- { "Asia/Katmandu" , 0x01C36C },
- { "Asia/Khandyga" , 0x01C3D2 },
- { "Asia/Kolkata" , 0x01C5F7 },
- { "Asia/Krasnoyarsk" , 0x01C670 },
- { "Asia/Kuala_Lumpur" , 0x01C858 },
- { "Asia/Kuching" , 0x01C915 },
- { "Asia/Kuwait" , 0x01CA03 },
- { "Asia/Macao" , 0x01CA58 },
- { "Asia/Macau" , 0x01CB93 },
- { "Asia/Magadan" , 0x01CCCE },
- { "Asia/Makassar" , 0x01CEB0 },
- { "Asia/Manila" , 0x01CF74 },
- { "Asia/Muscat" , 0x01CFF9 },
- { "Asia/Nicosia" , 0x01D04E },
- { "Asia/Novokuznetsk" , 0x01D336 },
- { "Asia/Novosibirsk" , 0x01D538 },
- { "Asia/Omsk" , 0x01D723 },
- { "Asia/Oral" , 0x01D90A },
- { "Asia/Phnom_Penh" , 0x01DADA },
- { "Asia/Pontianak" , 0x01DB52 },
- { "Asia/Pyongyang" , 0x01DC13 },
- { "Asia/Qatar" , 0x01DC80 },
- { "Asia/Qyzylorda" , 0x01DCE6 },
- { "Asia/Rangoon" , 0x01DEBC },
- { "Asia/Riyadh" , 0x01DF34 },
- { "Asia/Saigon" , 0x01DF89 },
- { "Asia/Sakhalin" , 0x01E001 },
- { "Asia/Samarkand" , 0x01E1F8 },
- { "Asia/Seoul" , 0x01E32E },
- { "Asia/Shanghai" , 0x01E3D2 },
- { "Asia/Singapore" , 0x01E4B2 },
- { "Asia/Taipei" , 0x01E569 },
- { "Asia/Tashkent" , 0x01E681 },
- { "Asia/Tbilisi" , 0x01E7B2 },
- { "Asia/Tehran" , 0x01E96C },
- { "Asia/Tel_Aviv" , 0x01EBDA },
- { "Asia/Thimbu" , 0x01EF09 },
- { "Asia/Thimphu" , 0x01EF6F },
- { "Asia/Tokyo" , 0x01EFD5 },
- { "Asia/Ujung_Pandang" , 0x01F05E },
- { "Asia/Ulaanbaatar" , 0x01F0DA },
- { "Asia/Ulan_Bator" , 0x01F235 },
- { "Asia/Urumqi" , 0x01F382 },
- { "Asia/Ust-Nera" , 0x01F449 },
- { "Asia/Vientiane" , 0x01F64E },
- { "Asia/Vladivostok" , 0x01F6C6 },
- { "Asia/Yakutsk" , 0x01F8B2 },
- { "Asia/Yekaterinburg" , 0x01FA97 },
- { "Asia/Yerevan" , 0x01FCA2 },
- { "Atlantic/Azores" , 0x01FEA2 },
- { "Atlantic/Bermuda" , 0x0203A5 },
- { "Atlantic/Canary" , 0x020686 },
- { "Atlantic/Cape_Verde" , 0x02095C },
- { "Atlantic/Faeroe" , 0x0209D5 },
- { "Atlantic/Faroe" , 0x020C79 },
- { "Atlantic/Jan_Mayen" , 0x020F1D },
- { "Atlantic/Madeira" , 0x02124F },
- { "Atlantic/Reykjavik" , 0x021758 },
- { "Atlantic/South_Georgia" , 0x021911 },
- { "Atlantic/St_Helena" , 0x021B23 },
- { "Atlantic/Stanley" , 0x021955 },
- { "Australia/ACT" , 0x021B78 },
- { "Australia/Adelaide" , 0x021E95 },
- { "Australia/Brisbane" , 0x0221C1 },
- { "Australia/Broken_Hill" , 0x022288 },
- { "Australia/Canberra" , 0x0225C6 },
- { "Australia/Currie" , 0x0228E3 },
- { "Australia/Darwin" , 0x022C16 },
- { "Australia/Eucla" , 0x022C9C },
- { "Australia/Hobart" , 0x022D71 },
- { "Australia/LHI" , 0x0230CF },
- { "Australia/Lindeman" , 0x02336A },
- { "Australia/Lord_Howe" , 0x02344B },
- { "Australia/Melbourne" , 0x0236F6 },
- { "Australia/North" , 0x023A1B },
- { "Australia/NSW" , 0x023A8F },
- { "Australia/Perth" , 0x023DAC },
- { "Australia/Queensland" , 0x023E84 },
- { "Australia/South" , 0x023F30 },
- { "Australia/Sydney" , 0x02424D },
- { "Australia/Tasmania" , 0x02458A },
- { "Australia/Victoria" , 0x0248CF },
- { "Australia/West" , 0x024BEC },
- { "Australia/Yancowinna" , 0x024CA2 },
- { "Brazil/Acre" , 0x024FC4 },
- { "Brazil/DeNoronha" , 0x0250C3 },
- { "Brazil/East" , 0x0251E3 },
- { "Brazil/West" , 0x0254C0 },
- { "Canada/Atlantic" , 0x0255B8 },
- { "Canada/Central" , 0x025AA0 },
- { "Canada/East-Saskatchewan" , 0x0263AA },
- { "Canada/Eastern" , 0x025EBA },
- { "Canada/Mountain" , 0x026533 },
- { "Canada/Newfoundland" , 0x0268A9 },
- { "Canada/Pacific" , 0x026DD4 },
- { "Canada/Saskatchewan" , 0x0271ED },
- { "Canada/Yukon" , 0x027376 },
- { "CET" , 0x027679 },
- { "Chile/Continental" , 0x027982 },
- { "Chile/EasterIsland" , 0x027D1D },
- { "CST6CDT" , 0x02805F },
- { "Cuba" , 0x0283B0 },
- { "EET" , 0x028723 },
- { "Egypt" , 0x0289D6 },
- { "Eire" , 0x028C99 },
- { "EST" , 0x0291AA },
- { "EST5EDT" , 0x0291EE },
- { "Etc/GMT" , 0x02953F },
- { "Etc/GMT+0" , 0x02960B },
- { "Etc/GMT+1" , 0x029695 },
- { "Etc/GMT+10" , 0x029722 },
- { "Etc/GMT+11" , 0x0297B0 },
- { "Etc/GMT+12" , 0x02983E },
- { "Etc/GMT+2" , 0x029959 },
- { "Etc/GMT+3" , 0x0299E5 },
- { "Etc/GMT+4" , 0x029A71 },
- { "Etc/GMT+5" , 0x029AFD },
- { "Etc/GMT+6" , 0x029B89 },
- { "Etc/GMT+7" , 0x029C15 },
- { "Etc/GMT+8" , 0x029CA1 },
- { "Etc/GMT+9" , 0x029D2D },
- { "Etc/GMT-0" , 0x0295C7 },
- { "Etc/GMT-1" , 0x02964F },
- { "Etc/GMT-10" , 0x0296DB },
- { "Etc/GMT-11" , 0x029769 },
- { "Etc/GMT-12" , 0x0297F7 },
- { "Etc/GMT-13" , 0x029885 },
- { "Etc/GMT-14" , 0x0298CC },
- { "Etc/GMT-2" , 0x029913 },
- { "Etc/GMT-3" , 0x02999F },
- { "Etc/GMT-4" , 0x029A2B },
- { "Etc/GMT-5" , 0x029AB7 },
- { "Etc/GMT-6" , 0x029B43 },
- { "Etc/GMT-7" , 0x029BCF },
- { "Etc/GMT-8" , 0x029C5B },
- { "Etc/GMT-9" , 0x029CE7 },
- { "Etc/GMT0" , 0x029583 },
- { "Etc/Greenwich" , 0x029D73 },
- { "Etc/UCT" , 0x029DB7 },
- { "Etc/Universal" , 0x029DFB },
- { "Etc/UTC" , 0x029E3F },
- { "Etc/Zulu" , 0x029E83 },
- { "Europe/Amsterdam" , 0x029EC7 },
- { "Europe/Andorra" , 0x02A305 },
- { "Europe/Athens" , 0x02A581 },
- { "Europe/Belfast" , 0x02A8C4 },
- { "Europe/Belgrade" , 0x02ADFB },
- { "Europe/Berlin" , 0x02B0C4 },
- { "Europe/Bratislava" , 0x02B428 },
- { "Europe/Brussels" , 0x02B75A },
- { "Europe/Bucharest" , 0x02BB91 },
- { "Europe/Budapest" , 0x02BEBB },
- { "Europe/Busingen" , 0x02C22E },
- { "Europe/Chisinau" , 0x02C4E5 },
- { "Europe/Copenhagen" , 0x02C873 },
- { "Europe/Dublin" , 0x02CB7D },
- { "Europe/Gibraltar" , 0x02D08E },
- { "Europe/Guernsey" , 0x02D4E5 },
- { "Europe/Helsinki" , 0x02DA1C },
- { "Europe/Isle_of_Man" , 0x02DCD2 },
- { "Europe/Istanbul" , 0x02E209 },
- { "Europe/Jersey" , 0x02E5F6 },
- { "Europe/Kaliningrad" , 0x02EB2D },
- { "Europe/Kiev" , 0x02ED93 },
- { "Europe/Lisbon" , 0x02F0AA },
- { "Europe/Ljubljana" , 0x02F5AE },
- { "Europe/London" , 0x02F877 },
- { "Europe/Luxembourg" , 0x02FDAE },
- { "Europe/Madrid" , 0x030204 },
- { "Europe/Malta" , 0x0305CA },
- { "Europe/Mariehamn" , 0x030983 },
- { "Europe/Minsk" , 0x030C39 },
- { "Europe/Monaco" , 0x030E47 },
- { "Europe/Moscow" , 0x031282 },
- { "Europe/Nicosia" , 0x0314D3 },
- { "Europe/Oslo" , 0x0317BB },
- { "Europe/Paris" , 0x031AED },
- { "Europe/Podgorica" , 0x031F33 },
- { "Europe/Prague" , 0x0321FC },
- { "Europe/Riga" , 0x03252E },
- { "Europe/Rome" , 0x032873 },
- { "Europe/Samara" , 0x032C36 },
- { "Europe/San_Marino" , 0x032E69 },
- { "Europe/Sarajevo" , 0x03322C },
- { "Europe/Simferopol" , 0x0334F5 },
- { "Europe/Skopje" , 0x033820 },
- { "Europe/Sofia" , 0x033AE9 },
- { "Europe/Stockholm" , 0x033DF1 },
- { "Europe/Tallinn" , 0x0340A0 },
- { "Europe/Tirane" , 0x0343DA },
- { "Europe/Tiraspol" , 0x0346E0 },
- { "Europe/Uzhgorod" , 0x034A6E },
- { "Europe/Vaduz" , 0x034D85 },
- { "Europe/Vatican" , 0x035018 },
- { "Europe/Vienna" , 0x0353DB },
- { "Europe/Vilnius" , 0x035708 },
- { "Europe/Volgograd" , 0x035A47 },
- { "Europe/Warsaw" , 0x035C47 },
- { "Europe/Zagreb" , 0x036028 },
- { "Europe/Zaporozhye" , 0x0362F1 },
- { "Europe/Zurich" , 0x036632 },
- { "Factory" , 0x0368E1 },
- { "GB" , 0x036952 },
- { "GB-Eire" , 0x036E89 },
- { "GMT" , 0x0373C0 },
- { "GMT+0" , 0x03748C },
- { "GMT-0" , 0x037448 },
- { "GMT0" , 0x037404 },
- { "Greenwich" , 0x0374D0 },
- { "Hongkong" , 0x037514 },
- { "HST" , 0x0376D6 },
- { "Iceland" , 0x03771A },
- { "Indian/Antananarivo" , 0x0378D3 },
- { "Indian/Chagos" , 0x037947 },
- { "Indian/Christmas" , 0x0379A9 },
- { "Indian/Cocos" , 0x0379ED },
- { "Indian/Comoro" , 0x037A31 },
- { "Indian/Kerguelen" , 0x037A86 },
- { "Indian/Mahe" , 0x037ADB },
- { "Indian/Maldives" , 0x037B30 },
- { "Indian/Mauritius" , 0x037B85 },
- { "Indian/Mayotte" , 0x037BFB },
- { "Indian/Reunion" , 0x037C50 },
- { "Iran" , 0x037CA5 },
- { "Israel" , 0x037F13 },
- { "Jamaica" , 0x038242 },
- { "Japan" , 0x038307 },
- { "Kwajalein" , 0x038390 },
- { "Libya" , 0x0383F3 },
- { "MET" , 0x0385EC },
- { "Mexico/BajaNorte" , 0x0388F5 },
- { "Mexico/BajaSur" , 0x038C5E },
- { "Mexico/General" , 0x038EA3 },
- { "MST" , 0x039101 },
- { "MST7MDT" , 0x039145 },
- { "Navajo" , 0x039496 },
- { "NZ" , 0x03980F },
- { "NZ-CHAT" , 0x039B8D },
- { "Pacific/Apia" , 0x039E75 },
- { "Pacific/Auckland" , 0x03A011 },
- { "Pacific/Chatham" , 0x03A39D },
- { "Pacific/Chuuk" , 0x03A694 },
- { "Pacific/Easter" , 0x03A6ED },
- { "Pacific/Efate" , 0x03AA4B },
- { "Pacific/Enderbury" , 0x03AB11 },
- { "Pacific/Fakaofo" , 0x03AB7F },
- { "Pacific/Fiji" , 0x03ABD0 },
- { "Pacific/Funafuti" , 0x03AD63 },
- { "Pacific/Galapagos" , 0x03ADA7 },
- { "Pacific/Gambier" , 0x03AE1F },
- { "Pacific/Guadalcanal" , 0x03AE84 },
- { "Pacific/Guam" , 0x03AED9 },
- { "Pacific/Honolulu" , 0x03AF2F },
- { "Pacific/Johnston" , 0x03AFA6 },
- { "Pacific/Kiritimati" , 0x03AFF8 },
- { "Pacific/Kosrae" , 0x03B063 },
- { "Pacific/Kwajalein" , 0x03B0C0 },
- { "Pacific/Majuro" , 0x03B12C },
- { "Pacific/Marquesas" , 0x03B18B },
- { "Pacific/Midway" , 0x03B1F2 },
- { "Pacific/Nauru" , 0x03B27C },
- { "Pacific/Niue" , 0x03B2F4 },
- { "Pacific/Norfolk" , 0x03B352 },
- { "Pacific/Noumea" , 0x03B3A7 },
- { "Pacific/Pago_Pago" , 0x03B437 },
- { "Pacific/Palau" , 0x03B4C0 },
- { "Pacific/Pitcairn" , 0x03B504 },
- { "Pacific/Pohnpei" , 0x03B559 },
- { "Pacific/Ponape" , 0x03B5AE },
- { "Pacific/Port_Moresby" , 0x03B5F3 },
- { "Pacific/Rarotonga" , 0x03B637 },
- { "Pacific/Saipan" , 0x03B713 },
- { "Pacific/Samoa" , 0x03B776 },
- { "Pacific/Tahiti" , 0x03B7FF },
- { "Pacific/Tarawa" , 0x03B864 },
- { "Pacific/Tongatapu" , 0x03B8B8 },
- { "Pacific/Truk" , 0x03B944 },
- { "Pacific/Wake" , 0x03B989 },
- { "Pacific/Wallis" , 0x03B9D9 },
- { "Pacific/Yap" , 0x03BA1D },
- { "Poland" , 0x03BA62 },
- { "Portugal" , 0x03BE43 },
- { "PRC" , 0x03C33F },
- { "PST8PDT" , 0x03C3F0 },
- { "ROC" , 0x03C741 },
- { "ROK" , 0x03C859 },
- { "Singapore" , 0x03C8FD },
- { "Turkey" , 0x03C9B4 },
- { "UCT" , 0x03CDA1 },
- { "Universal" , 0x03CDE5 },
- { "US/Alaska" , 0x03CE29 },
- { "US/Aleutian" , 0x03D192 },
- { "US/Arizona" , 0x03D4F8 },
- { "US/Central" , 0x03D586 },
- { "US/East-Indiana" , 0x03DF90 },
- { "US/Eastern" , 0x03DA91 },
- { "US/Hawaii" , 0x03E1FA },
- { "US/Indiana-Starke" , 0x03E26B },
- { "US/Michigan" , 0x03E5DC },
- { "US/Mountain" , 0x03E913 },
- { "US/Pacific" , 0x03EC8C },
- { "US/Pacific-New" , 0x03F091 },
- { "US/Samoa" , 0x03F496 },
- { "UTC" , 0x03F51F },
- { "W-SU" , 0x03F816 },
- { "WET" , 0x03F563 },
- { "Zulu" , 0x03FA50 },
+ { "Africa/Ceuta" , 0x000ABC },
+ { "Africa/Conakry" , 0x000DC3 },
+ { "Africa/Dakar" , 0x000E2E },
+ { "Africa/Dar_es_Salaam" , 0x000E94 },
+ { "Africa/Djibouti" , 0x000F01 },
+ { "Africa/Douala" , 0x000F56 },
+ { "Africa/El_Aaiun" , 0x000FAB },
+ { "Africa/Freetown" , 0x001011 },
+ { "Africa/Gaborone" , 0x001120 },
+ { "Africa/Harare" , 0x00118D },
+ { "Africa/Johannesburg" , 0x0011E2 },
+ { "Africa/Juba" , 0x001250 },
+ { "Africa/Kampala" , 0x001363 },
+ { "Africa/Khartoum" , 0x0013E2 },
+ { "Africa/Kigali" , 0x0014F5 },
+ { "Africa/Kinshasa" , 0x00154A },
+ { "Africa/Lagos" , 0x0015A5 },
+ { "Africa/Libreville" , 0x0015FA },
+ { "Africa/Lome" , 0x00164F },
+ { "Africa/Luanda" , 0x001693 },
+ { "Africa/Lubumbashi" , 0x0016E8 },
+ { "Africa/Lusaka" , 0x001743 },
+ { "Africa/Malabo" , 0x001798 },
+ { "Africa/Maputo" , 0x0017FE },
+ { "Africa/Maseru" , 0x001853 },
+ { "Africa/Mbabane" , 0x0018BB },
+ { "Africa/Mogadishu" , 0x001911 },
+ { "Africa/Monrovia" , 0x00196C },
+ { "Africa/Nairobi" , 0x0019D2 },
+ { "Africa/Ndjamena" , 0x001A51 },
+ { "Africa/Niamey" , 0x001ABD },
+ { "Africa/Nouakchott" , 0x001B30 },
+ { "Africa/Ouagadougou" , 0x001B9B },
+ { "Africa/Porto-Novo" , 0x001BF0 },
+ { "Africa/Sao_Tome" , 0x001C56 },
+ { "Africa/Timbuktu" , 0x001CAB },
+ { "Africa/Tripoli" , 0x001D16 },
+ { "Africa/Tunis" , 0x001F0F },
+ { "Africa/Windhoek" , 0x002021 },
+ { "America/Adak" , 0x002268 },
+ { "America/Anchorage" , 0x0025DE },
+ { "America/Anguilla" , 0x002952 },
+ { "America/Antigua" , 0x0029A7 },
+ { "America/Araguaina" , 0x002A0D },
+ { "America/Argentina/Buenos_Aires" , 0x002C67 },
+ { "America/Argentina/Catamarca" , 0x002E15 },
+ { "America/Argentina/ComodRivadavia" , 0x002FD6 },
+ { "America/Argentina/Cordoba" , 0x00317C },
+ { "America/Argentina/Jujuy" , 0x003351 },
+ { "America/Argentina/La_Rioja" , 0x003505 },
+ { "America/Argentina/Mendoza" , 0x0036BD },
+ { "America/Argentina/Rio_Gallegos" , 0x00387D },
+ { "America/Argentina/Salta" , 0x003A32 },
+ { "America/Argentina/San_Juan" , 0x003BDE },
+ { "America/Argentina/San_Luis" , 0x003D96 },
+ { "America/Argentina/Tucuman" , 0x003F5C },
+ { "America/Argentina/Ushuaia" , 0x004118 },
+ { "America/Aruba" , 0x0042D3 },
+ { "America/Asuncion" , 0x004339 },
+ { "America/Atikokan" , 0x00461E },
+ { "America/Atka" , 0x0046F4 },
+ { "America/Bahia" , 0x004A5A },
+ { "America/Bahia_Banderas" , 0x004BED },
+ { "America/Barbados" , 0x004E66 },
+ { "America/Belem" , 0x004F00 },
+ { "America/Belize" , 0x004FFB },
+ { "America/Blanc-Sablon" , 0x005177 },
+ { "America/Boa_Vista" , 0x00522B },
+ { "America/Bogota" , 0x005334 },
+ { "America/Boise" , 0x0053A0 },
+ { "America/Buenos_Aires" , 0x005737 },
+ { "America/Cambridge_Bay" , 0x0058D0 },
+ { "America/Campo_Grande" , 0x005BF8 },
+ { "America/Cancun" , 0x005EE7 },
+ { "America/Caracas" , 0x006129 },
+ { "America/Catamarca" , 0x006190 },
+ { "America/Cayenne" , 0x006336 },
+ { "America/Cayman" , 0x006398 },
+ { "America/Chicago" , 0x0063ED },
+ { "America/Chihuahua" , 0x006904 },
+ { "America/Coral_Harbour" , 0x006B6F },
+ { "America/Cordoba" , 0x006C01 },
+ { "America/Costa_Rica" , 0x006DA7 },
+ { "America/Creston" , 0x006E31 },
+ { "America/Cuiaba" , 0x006EBD },
+ { "America/Curacao" , 0x00719B },
+ { "America/Danmarkshavn" , 0x007201 },
+ { "America/Dawson" , 0x007345 },
+ { "America/Dawson_Creek" , 0x007662 },
+ { "America/Denver" , 0x00783C },
+ { "America/Detroit" , 0x007BC2 },
+ { "America/Dominica" , 0x007F21 },
+ { "America/Edmonton" , 0x007F76 },
+ { "America/Eirunepe" , 0x00832E },
+ { "America/El_Salvador" , 0x008441 },
+ { "America/Ensenada" , 0x0084B6 },
+ { "America/Fort_Wayne" , 0x00895D },
+ { "America/Fortaleza" , 0x00881F },
+ { "America/Glace_Bay" , 0x008BC7 },
+ { "America/Godthab" , 0x008F3E },
+ { "America/Goose_Bay" , 0x009202 },
+ { "America/Grand_Turk" , 0x0096BF },
+ { "America/Grenada" , 0x00996E },
+ { "America/Guadeloupe" , 0x0099C3 },
+ { "America/Guatemala" , 0x009A18 },
+ { "America/Guayaquil" , 0x009AA1 },
+ { "America/Guyana" , 0x009AFE },
+ { "America/Halifax" , 0x009B7F },
+ { "America/Havana" , 0x00A095 },
+ { "America/Hermosillo" , 0x00A408 },
+ { "America/Indiana/Indianapolis" , 0x00A4E6 },
+ { "America/Indiana/Knox" , 0x00A777 },
+ { "America/Indiana/Marengo" , 0x00AB0E },
+ { "America/Indiana/Petersburg" , 0x00ADB4 },
+ { "America/Indiana/Tell_City" , 0x00B301 },
+ { "America/Indiana/Vevay" , 0x00B59A },
+ { "America/Indiana/Vincennes" , 0x00B7D5 },
+ { "America/Indiana/Winamac" , 0x00BA89 },
+ { "America/Indianapolis" , 0x00B097 },
+ { "America/Inuvik" , 0x00BD42 },
+ { "America/Iqaluit" , 0x00C039 },
+ { "America/Jamaica" , 0x00C35B },
+ { "America/Jujuy" , 0x00C420 },
+ { "America/Juneau" , 0x00C5CA },
+ { "America/Kentucky/Louisville" , 0x00C948 },
+ { "America/Kentucky/Monticello" , 0x00CD66 },
+ { "America/Knox_IN" , 0x00D0EB },
+ { "America/Kralendijk" , 0x00D45C },
+ { "America/La_Paz" , 0x00D4C2 },
+ { "America/Lima" , 0x00D529 },
+ { "America/Los_Angeles" , 0x00D5D1 },
+ { "America/Louisville" , 0x00D9E2 },
+ { "America/Lower_Princes" , 0x00DDD7 },
+ { "America/Maceio" , 0x00DE3D },
+ { "America/Managua" , 0x00DF77 },
+ { "America/Manaus" , 0x00E02A },
+ { "America/Marigot" , 0x00E12C },
+ { "America/Martinique" , 0x00E181 },
+ { "America/Matamoros" , 0x00E1ED },
+ { "America/Mazatlan" , 0x00E446 },
+ { "America/Mendoza" , 0x00E6B3 },
+ { "America/Menominee" , 0x00E867 },
+ { "America/Merida" , 0x00EBE8 },
+ { "America/Metlakatla" , 0x00EE23 },
+ { "America/Mexico_City" , 0x00EF5D },
+ { "America/Miquelon" , 0x00F1D8 },
+ { "America/Moncton" , 0x00F44A },
+ { "America/Monterrey" , 0x00F8E1 },
+ { "America/Montevideo" , 0x00FB44 },
+ { "America/Montreal" , 0x00FE56 },
+ { "America/Montserrat" , 0x01036C },
+ { "America/Nassau" , 0x0103C1 },
+ { "America/New_York" , 0x010706 },
+ { "America/Nipigon" , 0x010C11 },
+ { "America/Nome" , 0x010F62 },
+ { "America/Noronha" , 0x0112E0 },
+ { "America/North_Dakota/Beulah" , 0x011410 },
+ { "America/North_Dakota/Center" , 0x0117A4 },
+ { "America/North_Dakota/New_Salem" , 0x011B38 },
+ { "America/Ojinaga" , 0x011EE1 },
+ { "America/Panama" , 0x012142 },
+ { "America/Pangnirtung" , 0x012197 },
+ { "America/Paramaribo" , 0x0124CD },
+ { "America/Phoenix" , 0x01255F },
+ { "America/Port-au-Prince" , 0x01260D },
+ { "America/Port_of_Spain" , 0x01292C },
+ { "America/Porto_Acre" , 0x01282D },
+ { "America/Porto_Velho" , 0x012981 },
+ { "America/Puerto_Rico" , 0x012A77 },
+ { "America/Rainy_River" , 0x012AE2 },
+ { "America/Rankin_Inlet" , 0x012E1A },
+ { "America/Recife" , 0x013100 },
+ { "America/Regina" , 0x01322A },
+ { "America/Resolute" , 0x0133E8 },
+ { "America/Rio_Branco" , 0x0136D9 },
+ { "America/Rosario" , 0x0137DC },
+ { "America/Santa_Isabel" , 0x013982 },
+ { "America/Santarem" , 0x013D25 },
+ { "America/Santiago" , 0x013E2A },
+ { "America/Santo_Domingo" , 0x0141D3 },
+ { "America/Sao_Paulo" , 0x014299 },
+ { "America/Scoresbysund" , 0x0145A8 },
+ { "America/Shiprock" , 0x014896 },
+ { "America/Sitka" , 0x014C25 },
+ { "America/St_Barthelemy" , 0x014FAD },
+ { "America/St_Johns" , 0x015002 },
+ { "America/St_Kitts" , 0x015555 },
+ { "America/St_Lucia" , 0x0155AA },
+ { "America/St_Thomas" , 0x0155FF },
+ { "America/St_Vincent" , 0x015654 },
+ { "America/Swift_Current" , 0x0156A9 },
+ { "America/Tegucigalpa" , 0x0157CA },
+ { "America/Thule" , 0x015849 },
+ { "America/Thunder_Bay" , 0x015A90 },
+ { "America/Tijuana" , 0x015DD9 },
+ { "America/Toronto" , 0x016172 },
+ { "America/Tortola" , 0x016689 },
+ { "America/Vancouver" , 0x0166DE },
+ { "America/Virgin" , 0x016B1B },
+ { "America/Whitehorse" , 0x016B70 },
+ { "America/Winnipeg" , 0x016E8D },
+ { "America/Yakutat" , 0x0172CD },
+ { "America/Yellowknife" , 0x017638 },
+ { "Antarctica/Casey" , 0x017948 },
+ { "Antarctica/Davis" , 0x0179E5 },
+ { "Antarctica/DumontDUrville" , 0x017A86 },
+ { "Antarctica/Macquarie" , 0x017B18 },
+ { "Antarctica/Mawson" , 0x017D92 },
+ { "Antarctica/McMurdo" , 0x017E0E },
+ { "Antarctica/Palmer" , 0x018110 },
+ { "Antarctica/Rothera" , 0x01842C },
+ { "Antarctica/South_Pole" , 0x0184A2 },
+ { "Antarctica/Syowa" , 0x0187AA },
+ { "Antarctica/Vostok" , 0x018818 },
+ { "Arctic/Longyearbyen" , 0x018889 },
+ { "Asia/Aden" , 0x018BBB },
+ { "Asia/Almaty" , 0x018C10 },
+ { "Asia/Amman" , 0x018D8F },
+ { "Asia/Anadyr" , 0x019045 },
+ { "Asia/Aqtau" , 0x01922A },
+ { "Asia/Aqtobe" , 0x019429 },
+ { "Asia/Ashgabat" , 0x0195E1 },
+ { "Asia/Ashkhabad" , 0x0196FE },
+ { "Asia/Baghdad" , 0x01981B },
+ { "Asia/Bahrain" , 0x019990 },
+ { "Asia/Baku" , 0x0199F6 },
+ { "Asia/Bangkok" , 0x019CDE },
+ { "Asia/Beirut" , 0x019D33 },
+ { "Asia/Bishkek" , 0x01A040 },
+ { "Asia/Brunei" , 0x01A1EC },
+ { "Asia/Calcutta" , 0x01A24E },
+ { "Asia/Choibalsan" , 0x01A2C7 },
+ { "Asia/Chongqing" , 0x01A440 },
+ { "Asia/Chungking" , 0x01A52F },
+ { "Asia/Colombo" , 0x01A5DE },
+ { "Asia/Dacca" , 0x01A67A },
+ { "Asia/Damascus" , 0x01A720 },
+ { "Asia/Dhaka" , 0x01AA70 },
+ { "Asia/Dili" , 0x01AB16 },
+ { "Asia/Dubai" , 0x01AB9F },
+ { "Asia/Dushanbe" , 0x01ABF4 },
+ { "Asia/Gaza" , 0x01ACF7 },
+ { "Asia/Harbin" , 0x01AF50 },
+ { "Asia/Hebron" , 0x01B037 },
+ { "Asia/Ho_Chi_Minh" , 0x01B299 },
+ { "Asia/Hong_Kong" , 0x01B311 },
+ { "Asia/Hovd" , 0x01B4D3 },
+ { "Asia/Irkutsk" , 0x01B64B },
+ { "Asia/Istanbul" , 0x01B831 },
+ { "Asia/Jakarta" , 0x01BC1E },
+ { "Asia/Jayapura" , 0x01BCC8 },
+ { "Asia/Jerusalem" , 0x01BD64 },
+ { "Asia/Kabul" , 0x01C093 },
+ { "Asia/Kamchatka" , 0x01C0E4 },
+ { "Asia/Karachi" , 0x01C2C0 },
+ { "Asia/Kashgar" , 0x01C375 },
+ { "Asia/Kathmandu" , 0x01C446 },
+ { "Asia/Katmandu" , 0x01C4AC },
+ { "Asia/Khandyga" , 0x01C512 },
+ { "Asia/Kolkata" , 0x01C737 },
+ { "Asia/Krasnoyarsk" , 0x01C7B0 },
+ { "Asia/Kuala_Lumpur" , 0x01C998 },
+ { "Asia/Kuching" , 0x01CA55 },
+ { "Asia/Kuwait" , 0x01CB43 },
+ { "Asia/Macao" , 0x01CB98 },
+ { "Asia/Macau" , 0x01CCD3 },
+ { "Asia/Magadan" , 0x01CE0E },
+ { "Asia/Makassar" , 0x01CFF0 },
+ { "Asia/Manila" , 0x01D0B4 },
+ { "Asia/Muscat" , 0x01D139 },
+ { "Asia/Nicosia" , 0x01D18E },
+ { "Asia/Novokuznetsk" , 0x01D476 },
+ { "Asia/Novosibirsk" , 0x01D678 },
+ { "Asia/Omsk" , 0x01D863 },
+ { "Asia/Oral" , 0x01DA4A },
+ { "Asia/Phnom_Penh" , 0x01DC1A },
+ { "Asia/Pontianak" , 0x01DC92 },
+ { "Asia/Pyongyang" , 0x01DD53 },
+ { "Asia/Qatar" , 0x01DDC0 },
+ { "Asia/Qyzylorda" , 0x01DE26 },
+ { "Asia/Rangoon" , 0x01DFFC },
+ { "Asia/Riyadh" , 0x01E074 },
+ { "Asia/Saigon" , 0x01E0C9 },
+ { "Asia/Sakhalin" , 0x01E141 },
+ { "Asia/Samarkand" , 0x01E338 },
+ { "Asia/Seoul" , 0x01E46E },
+ { "Asia/Shanghai" , 0x01E512 },
+ { "Asia/Singapore" , 0x01E5F2 },
+ { "Asia/Taipei" , 0x01E6A9 },
+ { "Asia/Tashkent" , 0x01E7C1 },
+ { "Asia/Tbilisi" , 0x01E8F2 },
+ { "Asia/Tehran" , 0x01EAAC },
+ { "Asia/Tel_Aviv" , 0x01ED1A },
+ { "Asia/Thimbu" , 0x01F049 },
+ { "Asia/Thimphu" , 0x01F0AF },
+ { "Asia/Tokyo" , 0x01F115 },
+ { "Asia/Ujung_Pandang" , 0x01F19E },
+ { "Asia/Ulaanbaatar" , 0x01F21A },
+ { "Asia/Ulan_Bator" , 0x01F375 },
+ { "Asia/Urumqi" , 0x01F4C2 },
+ { "Asia/Ust-Nera" , 0x01F589 },
+ { "Asia/Vientiane" , 0x01F78E },
+ { "Asia/Vladivostok" , 0x01F806 },
+ { "Asia/Yakutsk" , 0x01F9F2 },
+ { "Asia/Yekaterinburg" , 0x01FBD7 },
+ { "Asia/Yerevan" , 0x01FDE2 },
+ { "Atlantic/Azores" , 0x01FFE2 },
+ { "Atlantic/Bermuda" , 0x0204E5 },
+ { "Atlantic/Canary" , 0x0207C6 },
+ { "Atlantic/Cape_Verde" , 0x020A9C },
+ { "Atlantic/Faeroe" , 0x020B15 },
+ { "Atlantic/Faroe" , 0x020DB9 },
+ { "Atlantic/Jan_Mayen" , 0x02105D },
+ { "Atlantic/Madeira" , 0x02138F },
+ { "Atlantic/Reykjavik" , 0x021898 },
+ { "Atlantic/South_Georgia" , 0x021A51 },
+ { "Atlantic/St_Helena" , 0x021C63 },
+ { "Atlantic/Stanley" , 0x021A95 },
+ { "Australia/ACT" , 0x021CB8 },
+ { "Australia/Adelaide" , 0x021FD5 },
+ { "Australia/Brisbane" , 0x022301 },
+ { "Australia/Broken_Hill" , 0x0223C8 },
+ { "Australia/Canberra" , 0x022706 },
+ { "Australia/Currie" , 0x022A23 },
+ { "Australia/Darwin" , 0x022D56 },
+ { "Australia/Eucla" , 0x022DDC },
+ { "Australia/Hobart" , 0x022EB1 },
+ { "Australia/LHI" , 0x02320F },
+ { "Australia/Lindeman" , 0x0234AA },
+ { "Australia/Lord_Howe" , 0x02358B },
+ { "Australia/Melbourne" , 0x023836 },
+ { "Australia/North" , 0x023B5B },
+ { "Australia/NSW" , 0x023BCF },
+ { "Australia/Perth" , 0x023EEC },
+ { "Australia/Queensland" , 0x023FC4 },
+ { "Australia/South" , 0x024070 },
+ { "Australia/Sydney" , 0x02438D },
+ { "Australia/Tasmania" , 0x0246CA },
+ { "Australia/Victoria" , 0x024A0F },
+ { "Australia/West" , 0x024D2C },
+ { "Australia/Yancowinna" , 0x024DE2 },
+ { "Brazil/Acre" , 0x025104 },
+ { "Brazil/DeNoronha" , 0x025203 },
+ { "Brazil/East" , 0x025323 },
+ { "Brazil/West" , 0x025600 },
+ { "Canada/Atlantic" , 0x0256F8 },
+ { "Canada/Central" , 0x025BE0 },
+ { "Canada/East-Saskatchewan" , 0x0264EA },
+ { "Canada/Eastern" , 0x025FFA },
+ { "Canada/Mountain" , 0x026673 },
+ { "Canada/Newfoundland" , 0x0269E9 },
+ { "Canada/Pacific" , 0x026F14 },
+ { "Canada/Saskatchewan" , 0x02732D },
+ { "Canada/Yukon" , 0x0274B6 },
+ { "CET" , 0x0277B9 },
+ { "Chile/Continental" , 0x027AC2 },
+ { "Chile/EasterIsland" , 0x027E5D },
+ { "CST6CDT" , 0x02819F },
+ { "Cuba" , 0x0284F0 },
+ { "EET" , 0x028863 },
+ { "Egypt" , 0x028B16 },
+ { "Eire" , 0x028DD9 },
+ { "EST" , 0x0292EA },
+ { "EST5EDT" , 0x02932E },
+ { "Etc/GMT" , 0x02967F },
+ { "Etc/GMT+0" , 0x02974B },
+ { "Etc/GMT+1" , 0x0297D5 },
+ { "Etc/GMT+10" , 0x029862 },
+ { "Etc/GMT+11" , 0x0298F0 },
+ { "Etc/GMT+12" , 0x02997E },
+ { "Etc/GMT+2" , 0x029A99 },
+ { "Etc/GMT+3" , 0x029B25 },
+ { "Etc/GMT+4" , 0x029BB1 },
+ { "Etc/GMT+5" , 0x029C3D },
+ { "Etc/GMT+6" , 0x029CC9 },
+ { "Etc/GMT+7" , 0x029D55 },
+ { "Etc/GMT+8" , 0x029DE1 },
+ { "Etc/GMT+9" , 0x029E6D },
+ { "Etc/GMT-0" , 0x029707 },
+ { "Etc/GMT-1" , 0x02978F },
+ { "Etc/GMT-10" , 0x02981B },
+ { "Etc/GMT-11" , 0x0298A9 },
+ { "Etc/GMT-12" , 0x029937 },
+ { "Etc/GMT-13" , 0x0299C5 },
+ { "Etc/GMT-14" , 0x029A0C },
+ { "Etc/GMT-2" , 0x029A53 },
+ { "Etc/GMT-3" , 0x029ADF },
+ { "Etc/GMT-4" , 0x029B6B },
+ { "Etc/GMT-5" , 0x029BF7 },
+ { "Etc/GMT-6" , 0x029C83 },
+ { "Etc/GMT-7" , 0x029D0F },
+ { "Etc/GMT-8" , 0x029D9B },
+ { "Etc/GMT-9" , 0x029E27 },
+ { "Etc/GMT0" , 0x0296C3 },
+ { "Etc/Greenwich" , 0x029EB3 },
+ { "Etc/UCT" , 0x029EF7 },
+ { "Etc/Universal" , 0x029F3B },
+ { "Etc/UTC" , 0x029F7F },
+ { "Etc/Zulu" , 0x029FC3 },
+ { "Europe/Amsterdam" , 0x02A007 },
+ { "Europe/Andorra" , 0x02A445 },
+ { "Europe/Athens" , 0x02A6C1 },
+ { "Europe/Belfast" , 0x02AA04 },
+ { "Europe/Belgrade" , 0x02AF3B },
+ { "Europe/Berlin" , 0x02B204 },
+ { "Europe/Bratislava" , 0x02B568 },
+ { "Europe/Brussels" , 0x02B89A },
+ { "Europe/Bucharest" , 0x02BCD1 },
+ { "Europe/Budapest" , 0x02BFFB },
+ { "Europe/Busingen" , 0x02C36E },
+ { "Europe/Chisinau" , 0x02C625 },
+ { "Europe/Copenhagen" , 0x02C9B3 },
+ { "Europe/Dublin" , 0x02CCBD },
+ { "Europe/Gibraltar" , 0x02D1CE },
+ { "Europe/Guernsey" , 0x02D625 },
+ { "Europe/Helsinki" , 0x02DB5C },
+ { "Europe/Isle_of_Man" , 0x02DE12 },
+ { "Europe/Istanbul" , 0x02E349 },
+ { "Europe/Jersey" , 0x02E736 },
+ { "Europe/Kaliningrad" , 0x02EC6D },
+ { "Europe/Kiev" , 0x02EED3 },
+ { "Europe/Lisbon" , 0x02F1EA },
+ { "Europe/Ljubljana" , 0x02F6EE },
+ { "Europe/London" , 0x02F9B7 },
+ { "Europe/Luxembourg" , 0x02FEEE },
+ { "Europe/Madrid" , 0x030344 },
+ { "Europe/Malta" , 0x03070A },
+ { "Europe/Mariehamn" , 0x030AC3 },
+ { "Europe/Minsk" , 0x030D79 },
+ { "Europe/Monaco" , 0x030F87 },
+ { "Europe/Moscow" , 0x0313C2 },
+ { "Europe/Nicosia" , 0x031613 },
+ { "Europe/Oslo" , 0x0318FB },
+ { "Europe/Paris" , 0x031C2D },
+ { "Europe/Podgorica" , 0x032073 },
+ { "Europe/Prague" , 0x03233C },
+ { "Europe/Riga" , 0x03266E },
+ { "Europe/Rome" , 0x0329B3 },
+ { "Europe/Samara" , 0x032D76 },
+ { "Europe/San_Marino" , 0x032FA9 },
+ { "Europe/Sarajevo" , 0x03336C },
+ { "Europe/Simferopol" , 0x033635 },
+ { "Europe/Skopje" , 0x033960 },
+ { "Europe/Sofia" , 0x033C29 },
+ { "Europe/Stockholm" , 0x033F31 },
+ { "Europe/Tallinn" , 0x0341E0 },
+ { "Europe/Tirane" , 0x03451A },
+ { "Europe/Tiraspol" , 0x034820 },
+ { "Europe/Uzhgorod" , 0x034BAE },
+ { "Europe/Vaduz" , 0x034EC5 },
+ { "Europe/Vatican" , 0x035158 },
+ { "Europe/Vienna" , 0x03551B },
+ { "Europe/Vilnius" , 0x035848 },
+ { "Europe/Volgograd" , 0x035B87 },
+ { "Europe/Warsaw" , 0x035D87 },
+ { "Europe/Zagreb" , 0x036168 },
+ { "Europe/Zaporozhye" , 0x036431 },
+ { "Europe/Zurich" , 0x036772 },
+ { "Factory" , 0x036A21 },
+ { "GB" , 0x036A92 },
+ { "GB-Eire" , 0x036FC9 },
+ { "GMT" , 0x037500 },
+ { "GMT+0" , 0x0375CC },
+ { "GMT-0" , 0x037588 },
+ { "GMT0" , 0x037544 },
+ { "Greenwich" , 0x037610 },
+ { "Hongkong" , 0x037654 },
+ { "HST" , 0x037816 },
+ { "Iceland" , 0x03785A },
+ { "Indian/Antananarivo" , 0x037A13 },
+ { "Indian/Chagos" , 0x037A87 },
+ { "Indian/Christmas" , 0x037AE9 },
+ { "Indian/Cocos" , 0x037B2D },
+ { "Indian/Comoro" , 0x037B71 },
+ { "Indian/Kerguelen" , 0x037BC6 },
+ { "Indian/Mahe" , 0x037C1B },
+ { "Indian/Maldives" , 0x037C70 },
+ { "Indian/Mauritius" , 0x037CC5 },
+ { "Indian/Mayotte" , 0x037D3B },
+ { "Indian/Reunion" , 0x037D90 },
+ { "Iran" , 0x037DE5 },
+ { "Israel" , 0x038053 },
+ { "Jamaica" , 0x038382 },
+ { "Japan" , 0x038447 },
+ { "Kwajalein" , 0x0384D0 },
+ { "Libya" , 0x038533 },
+ { "MET" , 0x03872C },
+ { "Mexico/BajaNorte" , 0x038A35 },
+ { "Mexico/BajaSur" , 0x038D9E },
+ { "Mexico/General" , 0x038FE3 },
+ { "MST" , 0x039241 },
+ { "MST7MDT" , 0x039285 },
+ { "Navajo" , 0x0395D6 },
+ { "NZ" , 0x03994F },
+ { "NZ-CHAT" , 0x039CCD },
+ { "Pacific/Apia" , 0x039FB5 },
+ { "Pacific/Auckland" , 0x03A151 },
+ { "Pacific/Chatham" , 0x03A4DD },
+ { "Pacific/Chuuk" , 0x03A7D4 },
+ { "Pacific/Easter" , 0x03A82D },
+ { "Pacific/Efate" , 0x03AB8B },
+ { "Pacific/Enderbury" , 0x03AC51 },
+ { "Pacific/Fakaofo" , 0x03ACBF },
+ { "Pacific/Fiji" , 0x03AD10 },
+ { "Pacific/Funafuti" , 0x03AEA3 },
+ { "Pacific/Galapagos" , 0x03AEE7 },
+ { "Pacific/Gambier" , 0x03AF5F },
+ { "Pacific/Guadalcanal" , 0x03AFC4 },
+ { "Pacific/Guam" , 0x03B019 },
+ { "Pacific/Honolulu" , 0x03B06F },
+ { "Pacific/Johnston" , 0x03B0E6 },
+ { "Pacific/Kiritimati" , 0x03B138 },
+ { "Pacific/Kosrae" , 0x03B1A3 },
+ { "Pacific/Kwajalein" , 0x03B200 },
+ { "Pacific/Majuro" , 0x03B26C },
+ { "Pacific/Marquesas" , 0x03B2CB },
+ { "Pacific/Midway" , 0x03B332 },
+ { "Pacific/Nauru" , 0x03B3BC },
+ { "Pacific/Niue" , 0x03B434 },
+ { "Pacific/Norfolk" , 0x03B492 },
+ { "Pacific/Noumea" , 0x03B4E7 },
+ { "Pacific/Pago_Pago" , 0x03B577 },
+ { "Pacific/Palau" , 0x03B600 },
+ { "Pacific/Pitcairn" , 0x03B644 },
+ { "Pacific/Pohnpei" , 0x03B699 },
+ { "Pacific/Ponape" , 0x03B6EE },
+ { "Pacific/Port_Moresby" , 0x03B733 },
+ { "Pacific/Rarotonga" , 0x03B777 },
+ { "Pacific/Saipan" , 0x03B853 },
+ { "Pacific/Samoa" , 0x03B8B6 },
+ { "Pacific/Tahiti" , 0x03B93F },
+ { "Pacific/Tarawa" , 0x03B9A4 },
+ { "Pacific/Tongatapu" , 0x03B9F8 },
+ { "Pacific/Truk" , 0x03BA84 },
+ { "Pacific/Wake" , 0x03BAC9 },
+ { "Pacific/Wallis" , 0x03BB19 },
+ { "Pacific/Yap" , 0x03BB5D },
+ { "Poland" , 0x03BBA2 },
+ { "Portugal" , 0x03BF83 },
+ { "PRC" , 0x03C47F },
+ { "PST8PDT" , 0x03C530 },
+ { "ROC" , 0x03C881 },
+ { "ROK" , 0x03C999 },
+ { "Singapore" , 0x03CA3D },
+ { "Turkey" , 0x03CAF4 },
+ { "UCT" , 0x03CEE1 },
+ { "Universal" , 0x03CF25 },
+ { "US/Alaska" , 0x03CF69 },
+ { "US/Aleutian" , 0x03D2D2 },
+ { "US/Arizona" , 0x03D638 },
+ { "US/Central" , 0x03D6C6 },
+ { "US/East-Indiana" , 0x03E0D0 },
+ { "US/Eastern" , 0x03DBD1 },
+ { "US/Hawaii" , 0x03E33A },
+ { "US/Indiana-Starke" , 0x03E3AB },
+ { "US/Michigan" , 0x03E71C },
+ { "US/Mountain" , 0x03EA53 },
+ { "US/Pacific" , 0x03EDCC },
+ { "US/Pacific-New" , 0x03F1D1 },
+ { "US/Samoa" , 0x03F5D6 },
+ { "UTC" , 0x03F65F },
+ { "W-SU" , 0x03F956 },
+ { "WET" , 0x03F6A3 },
+ { "Zulu" , 0x03FB90 },
};
/* This is a generated file, do not modify */
-const unsigned char timelib_timezone_db_data_builtin[260756] = {
+const unsigned char timelib_timezone_db_data_builtin[261076] = {
/* Africa/Abidjan */
@@ -758,7 +758,7 @@ const unsigned char timelib_timezone_db_data_builtin[260756] = {
/* Africa/Casablanca */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x96, 0x51, 0xF9, 0x9C,
+0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x96, 0x51, 0xF9, 0x9C,
0xC6, 0xFF, 0x14, 0x80, 0xC7, 0x58, 0xAC, 0x70, 0xC7, 0xD9, 0xED, 0x80, 0xD2, 0xA1, 0x32, 0xF0,
0xDB, 0x35, 0xA4, 0x00, 0xDB, 0xEE, 0x27, 0xF0, 0xFB, 0x25, 0x72, 0x40, 0xFB, 0xC2, 0xEF, 0x70,
0x08, 0x6B, 0x84, 0x80, 0x08, 0xC6, 0x6D, 0xF0, 0x0B, 0xE8, 0x0C, 0x00, 0x0C, 0x61, 0x47, 0xF0,
@@ -766,28 +766,33 @@ const unsigned char timelib_timezone_db_data_builtin[260756] = {
0x1A, 0xB7, 0xA6, 0x00, 0x1E, 0x18, 0x6F, 0xF0, 0x48, 0x41, 0xE6, 0x80, 0x48, 0xBB, 0x22, 0x70,
0x4A, 0x23, 0x1A, 0x00, 0x4A, 0x8D, 0xD5, 0x70, 0x4B, 0xDC, 0xC0, 0x80, 0x4C, 0x5D, 0xE5, 0x70,
0x4D, 0x97, 0xB8, 0x80, 0x4E, 0x34, 0x8C, 0xF0, 0x4F, 0x9C, 0xA0, 0xA0, 0x50, 0x08, 0xBB, 0xA0,
-0x50, 0x31, 0x9A, 0x20, 0x50, 0x67, 0xA7, 0xA0, 0x51, 0x7C, 0x82, 0xA0, 0x52, 0x47, 0x89, 0xA0,
-0x53, 0x5C, 0x64, 0xA0, 0x54, 0x27, 0x6B, 0xA0, 0x55, 0x3C, 0x46, 0xA0, 0x56, 0x07, 0x4D, 0xA0,
-0x57, 0x1C, 0x28, 0xA0, 0x57, 0xE7, 0x2F, 0xA0, 0x59, 0x05, 0x45, 0x20, 0x59, 0xC7, 0x11, 0xA0,
-0x5A, 0xE5, 0x27, 0x20, 0x5B, 0xB0, 0x2E, 0x20, 0x5C, 0xC5, 0x09, 0x20, 0x5D, 0x90, 0x10, 0x20,
-0x5E, 0xA4, 0xEB, 0x20, 0x5F, 0x6F, 0xF2, 0x20, 0x60, 0x84, 0xCD, 0x20, 0x61, 0x4F, 0xD4, 0x20,
-0x62, 0x64, 0xAF, 0x20, 0x63, 0x2F, 0xB6, 0x20, 0x64, 0x4D, 0xCB, 0xA0, 0x65, 0x0F, 0x98, 0x20,
-0x66, 0x2D, 0xAD, 0xA0, 0x66, 0xF8, 0xB4, 0xA0, 0x68, 0x0D, 0x8F, 0xA0, 0x68, 0xD8, 0x96, 0xA0,
-0x69, 0xED, 0x71, 0xA0, 0x6A, 0xB8, 0x78, 0xA0, 0x6B, 0xCD, 0x53, 0xA0, 0x6C, 0x98, 0x5A, 0xA0,
-0x6D, 0xB6, 0x70, 0x20, 0x6E, 0x78, 0x3C, 0xA0, 0x6F, 0x96, 0x52, 0x20, 0x70, 0x61, 0x59, 0x20,
-0x71, 0x76, 0x34, 0x20, 0x72, 0x41, 0x3B, 0x20, 0x73, 0x56, 0x16, 0x20, 0x74, 0x21, 0x1D, 0x20,
-0x75, 0x35, 0xF8, 0x20, 0x76, 0x00, 0xFF, 0x20, 0x77, 0x15, 0xDA, 0x20, 0x77, 0xE0, 0xE1, 0x20,
-0x78, 0xFE, 0xF6, 0xA0, 0x79, 0xC0, 0xC3, 0x20, 0x7A, 0xDE, 0xD8, 0xA0, 0x7B, 0xA9, 0xDF, 0xA0,
-0x7C, 0xBE, 0xBA, 0xA0, 0x7D, 0x89, 0xC1, 0xA0, 0x7E, 0x9E, 0x9C, 0xA0, 0x7F, 0x69, 0xA3, 0xA0,
+0x50, 0x31, 0x9A, 0x20, 0x50, 0x67, 0xA7, 0xA0, 0x51, 0x7C, 0x82, 0xA0, 0x51, 0xDB, 0x6E, 0xA0,
+0x52, 0x02, 0xFB, 0xA0, 0x52, 0x47, 0x89, 0xA0, 0x53, 0x5C, 0x64, 0xA0, 0x53, 0xAF, 0x73, 0x20,
+0x53, 0xD7, 0x00, 0x20, 0x54, 0x27, 0x6B, 0xA0, 0x55, 0x3C, 0x46, 0xA0, 0x55, 0x82, 0x26, 0x20,
+0x55, 0xA9, 0xB3, 0x20, 0x56, 0x07, 0x4D, 0xA0, 0x57, 0x1C, 0x28, 0xA0, 0x57, 0x56, 0x2A, 0xA0,
+0x57, 0x7D, 0xB7, 0xA0, 0x57, 0xE7, 0x2F, 0xA0, 0x59, 0x05, 0x45, 0x20, 0x59, 0x28, 0xDD, 0xA0,
+0x59, 0x50, 0x6A, 0xA0, 0x59, 0xC7, 0x11, 0xA0, 0x5A, 0xE5, 0x27, 0x20, 0x5A, 0xFB, 0x90, 0xA0,
+0x5B, 0x23, 0x1D, 0xA0, 0x5B, 0xB0, 0x2E, 0x20, 0x5C, 0xC5, 0x09, 0x20, 0x5C, 0xCF, 0x95, 0x20,
+0x5C, 0xF7, 0x22, 0x20, 0x5D, 0x90, 0x10, 0x20, 0x5E, 0xC9, 0xD5, 0x20, 0x5F, 0x6F, 0xF2, 0x20,
+0x60, 0x9C, 0x88, 0x20, 0x61, 0x4F, 0xD4, 0x20, 0x62, 0x70, 0x8C, 0xA0, 0x63, 0x2F, 0xB6, 0x20,
+0x64, 0x4D, 0xCB, 0xA0, 0x65, 0x0F, 0x98, 0x20, 0x66, 0x2D, 0xAD, 0xA0, 0x66, 0xF8, 0xB4, 0xA0,
+0x68, 0x0D, 0x8F, 0xA0, 0x68, 0xD8, 0x96, 0xA0, 0x69, 0xED, 0x71, 0xA0, 0x6A, 0xB8, 0x78, 0xA0,
+0x6B, 0xCD, 0x53, 0xA0, 0x6C, 0x98, 0x5A, 0xA0, 0x6D, 0xB6, 0x70, 0x20, 0x6E, 0x78, 0x3C, 0xA0,
+0x6F, 0x96, 0x52, 0x20, 0x70, 0x61, 0x59, 0x20, 0x71, 0x76, 0x34, 0x20, 0x72, 0x41, 0x3B, 0x20,
+0x73, 0x56, 0x16, 0x20, 0x74, 0x21, 0x1D, 0x20, 0x75, 0x35, 0xF8, 0x20, 0x76, 0x00, 0xFF, 0x20,
+0x77, 0x15, 0xDA, 0x20, 0x77, 0xE0, 0xE1, 0x20, 0x78, 0xFE, 0xF6, 0xA0, 0x79, 0xC0, 0xC3, 0x20,
+0x7A, 0xDE, 0xD8, 0xA0, 0x7B, 0xA9, 0xDF, 0xA0, 0x7C, 0xBE, 0xBA, 0xA0, 0x7D, 0x89, 0xC1, 0xA0,
+0x7E, 0x9E, 0x9C, 0xA0, 0x7F, 0x69, 0xA3, 0xA0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
-0x02, 0x03, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
-0x02, 0xFF, 0xFF, 0xF8, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x53,
-0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0xBC, 0xAC, 0xC8, 0x01, 0x07, 0x16, 0x42, 0x00, 0x00, 0x00, 0x00,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xF8, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x0E,
+0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x4C,
+0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBC, 0xAC, 0xC8, 0x01, 0x07, 0x16, 0x42,
+0x00, 0x00, 0x00, 0x00,
/* Africa/Ceuta */
0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -1863,7 +1868,7 @@ const unsigned char timelib_timezone_db_data_builtin[260756] = {
0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, 0x47, 0x1A, 0xCE, 0xC0, 0x47, 0xD3, 0x52, 0xB0,
0x48, 0xFA, 0xB0, 0xC0, 0x49, 0xB3, 0x34, 0xB0, 0x4A, 0xDA, 0x92, 0xC0, 0x4B, 0xC1, 0x3B, 0x30,
0x4C, 0xA7, 0xFF, 0xC0, 0x4D, 0xA1, 0x1D, 0x30, 0x4E, 0x87, 0xE1, 0xC0, 0x4F, 0x80, 0xFF, 0x30,
-0x50, 0x70, 0xFE, 0x40, 0x51, 0x6A, 0x1B, 0xB0, 0x52, 0x50, 0xE0, 0x40, 0x53, 0x49, 0xFD, 0xB0,
+0x50, 0x70, 0xFE, 0x40, 0x51, 0x4E, 0x6C, 0x30, 0x52, 0x50, 0xE0, 0x40, 0x53, 0x49, 0xFD, 0xB0,
0x54, 0x30, 0xC2, 0x40, 0x55, 0x29, 0xDF, 0xB0, 0x56, 0x10, 0xA4, 0x40, 0x57, 0x09, 0xC1, 0xB0,
0x57, 0xF0, 0x86, 0x40, 0x58, 0xE9, 0xA3, 0xB0, 0x59, 0xD0, 0x68, 0x40, 0x5A, 0xC9, 0x85, 0xB0,
0x5B, 0xB9, 0x84, 0xC0, 0x5C, 0xB2, 0xA2, 0x30, 0x5D, 0x99, 0x66, 0xC0, 0x5E, 0x92, 0x84, 0x30,
@@ -5743,7 +5748,7 @@ const unsigned char timelib_timezone_db_data_builtin[260756] = {
/* America/Port-au-Prince */
0x50, 0x48, 0x50, 0x31, 0x01, 0x48, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x9C, 0x6E, 0x71, 0xFC,
+0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x9C, 0x6E, 0x71, 0xFC,
0x19, 0x1B, 0x46, 0xD0, 0x1A, 0x01, 0xEF, 0x40, 0x1A, 0xF1, 0xEE, 0x50, 0x1B, 0xE1, 0xD1, 0x40,
0x1C, 0xD1, 0xD0, 0x50, 0x1D, 0xC1, 0xB3, 0x40, 0x1E, 0xB1, 0xB2, 0x50, 0x1F, 0xA1, 0x95, 0x40,
0x20, 0x91, 0x94, 0x50, 0x21, 0x81, 0x77, 0x40, 0x22, 0x55, 0xD4, 0xE0, 0x23, 0x6A, 0xAF, 0xE0,
@@ -5753,13 +5758,29 @@ const unsigned char timelib_timezone_db_data_builtin[260756] = {
0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x59, 0xE0, 0x32, 0x72, 0xFA, 0x60,
0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xDC, 0x60, 0x42, 0x4F, 0x78, 0x50, 0x43, 0x64, 0x45, 0x40,
0x44, 0x2F, 0x5A, 0x50, 0x45, 0x44, 0x27, 0x40, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60,
-0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03,
-0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01,
-0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xBC, 0x44, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01,
-0x05, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x05, 0xFF, 0xFF, 0xB9,
-0xB0, 0x00, 0x09, 0x50, 0x50, 0x4D, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00,
-0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0x9B, 0xD5, 0x00, 0xA4,
-0x49, 0x4A, 0x00, 0x00, 0x00, 0x00,
+0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60,
+0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0,
+0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0,
+0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0,
+0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60,
+0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60,
+0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60,
+0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0,
+0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0,
+0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60,
+0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60,
+0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60,
+0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF,
+0xFF, 0xBC, 0x44, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x05, 0xFF, 0xFF, 0xB9, 0xB0, 0x00,
+0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x05, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x50, 0x50, 0x4D,
+0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0x9B, 0xD5, 0x00, 0xA4, 0x49, 0x4A, 0x00, 0x00, 0x00, 0x00,
+
/* America/Porto_Acre */
0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -18361,4 +18382,4 @@ const unsigned char timelib_timezone_db_data_builtin[260756] = {
0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80,
0x00, 0x00, 0x00, 0x00, };
-const timelib_tzdb timezonedb_builtin = { "2013.1", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
+const timelib_tzdb timezonedb_builtin = { "2013.2", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 71958578de..f36ccc1ade 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1867,11 +1867,10 @@ static void date_period_it_current_data(zend_object_iterator *iter, zval ***data
/* {{{ date_period_it_current_key */
-static int date_period_it_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
+static void date_period_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
- date_period_it *iterator = (date_period_it *)iter;
- *int_key = iterator->current_index;
- return HASH_KEY_IS_LONG;
+ date_period_it *iterator = (date_period_it *)iter;
+ ZVAL_LONG(key, iterator->current_index);
}
/* }}} */
diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c
index f4183d2f9a..6c8cf84e9f 100644
--- a/ext/dom/dom_iterators.c
+++ b/ext/dom/dom_iterators.c
@@ -157,35 +157,22 @@ static void php_dom_iterator_current_data(zend_object_iterator *iter, zval ***da
}
/* }}} */
-static int php_dom_iterator_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) /* {{{ */
+static void php_dom_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
{
- zval *curobj;
- xmlNodePtr curnode = NULL;
- dom_object *intern;
- zval *object;
- int namelen;
-
php_dom_iterator *iterator = (php_dom_iterator *)iter;
-
- object = (zval *)iterator->intern.data;
+ zval *object = (zval *)iterator->intern.data;
if (instanceof_function(Z_OBJCE_P(object), dom_nodelist_class_entry TSRMLS_CC)) {
- *int_key = iter->index;
- return HASH_KEY_IS_LONG;
+ ZVAL_LONG(key, iter->index);
} else {
- curobj = iterator->curobj;
+ dom_object *intern = (dom_object *)zend_object_store_get_object(iterator->curobj TSRMLS_CC);
- intern = (dom_object *)zend_object_store_get_object(curobj TSRMLS_CC);
if (intern != NULL && intern->ptr != NULL) {
- curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->ptr)->node;
+ xmlNodePtr curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->ptr)->node;
+ ZVAL_STRINGL(key, (char *) curnode->name, xmlStrlen(curnode->name), 1);
} else {
- return HASH_KEY_NON_EXISTANT;
+ ZVAL_NULL(key);
}
-
- namelen = xmlStrlen(curnode->name);
- *str_key = estrndup(curnode->name, namelen);
- *str_key_len = namelen + 1;
- return HASH_KEY_IS_STRING;
}
}
/* }}} */
diff --git a/ext/intl/breakiterator/breakiterator_iterators.cpp b/ext/intl/breakiterator/breakiterator_iterators.cpp
index d88ad8a712..3748991aed 100644
--- a/ext/intl/breakiterator/breakiterator_iterators.cpp
+++ b/ext/intl/breakiterator/breakiterator_iterators.cpp
@@ -139,14 +139,10 @@ static void _breakiterator_parts_destroy_it(zend_object_iterator *iter TSRMLS_DC
zval_ptr_dtor(reinterpret_cast<zval**>(&iter->data));
}
-static int _breakiterator_parts_get_current_key(zend_object_iterator *iter,
- char **str_key,
- uint *str_key_len,
- ulong *int_key TSRMLS_DC)
+static void _breakiterator_parts_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
/* the actual work is done in move_forward and rewind */
- *int_key = iter->index;
- return HASH_KEY_IS_LONG;
+ ZVAL_LONG(key, iter->index);
}
static void _breakiterator_parts_move_forward(zend_object_iterator *iter TSRMLS_DC)
@@ -343,4 +339,4 @@ U_CFUNC void breakiterator_register_IntlPartsIterator_class(TSRMLS_D)
PARTSITER_DECL_LONG_CONST(KEY_RIGHT);
#undef PARTSITER_DECL_LONG_CONST
-} \ No newline at end of file
+}
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);
}
diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.c b/ext/intl/resourcebundle/resourcebundle_iterator.c
index 16e1b92879..78236fda5d 100644
--- a/ext/intl/resourcebundle/resourcebundle_iterator.c
+++ b/ext/intl/resourcebundle/resourcebundle_iterator.c
@@ -101,21 +101,18 @@ static void resourcebundle_iterator_current( zend_object_iterator *iter, zval **
/* }}} */
/* {{{ resourcebundle_iterator_key */
-static int resourcebundle_iterator_key( zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC )
+static void resourcebundle_iterator_key( zend_object_iterator *iter, zval *key TSRMLS_DC )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
if (!iterator->current) {
resourcebundle_iterator_read( iterator TSRMLS_CC);
}
+
if (iterator->is_table) {
- *str_key = estrdup( iterator->currentkey );
- *str_key_len = strlen( iterator->currentkey ) + 1;
- return HASH_KEY_IS_STRING;
- }
- else {
- *int_key = iterator->i;
- return HASH_KEY_IS_LONG;
+ ZVAL_STRING(key, iterator->currentkey, 1);
+ } else {
+ ZVAL_LONG(key, iterator->i);
}
}
/* }}} */
diff --git a/ext/mysqli/mysqli_result_iterator.c b/ext/mysqli/mysqli_result_iterator.c
index 0f5ccdd63d..3ea7bafe49 100644
--- a/ext/mysqli/mysqli_result_iterator.c
+++ b/ext/mysqli/mysqli_result_iterator.c
@@ -150,12 +150,11 @@ static void php_mysqli_result_iterator_rewind(zend_object_iterator *iter TSRMLS_
/* {{{ php_mysqli_result_iterator_current_key */
-static int php_mysqli_result_iterator_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
+static void php_mysqli_result_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*) iter;
- *int_key = (ulong) iterator->row_num;
- return HASH_KEY_IS_LONG;
+ ZVAL_LONG(key, iterator->row_num);
}
/* }}} */
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c
index 4916c0650d..15b293825b 100644
--- a/ext/mysqlnd/mysqlnd_ps.c
+++ b/ext/mysqlnd/mysqlnd_ps.c
@@ -1463,7 +1463,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_parameter)(MYSQLND_STMT * const s, unsigne
if (stmt->param_count) {
if (!stmt->param_bind) {
- stmt->param_bind = mnd_ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND));
+ stmt->param_bind = mnd_pecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND), stmt->persistent);
if (!stmt->param_bind) {
DBG_RETURN(FAIL);
}
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 5dc445ff8d..1b0db91c38 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -2499,16 +2499,15 @@ static void pdo_stmt_iter_get_data(zend_object_iterator *iter, zval ***data TSRM
*data = &I->fetch_ahead;
}
-static int pdo_stmt_iter_get_key(zend_object_iterator *iter, char **str_key, uint *str_key_len,
- ulong *int_key TSRMLS_DC)
+static void pdo_stmt_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter->data;
if (I->key == (ulong)-1) {
- return HASH_KEY_NON_EXISTANT;
+ ZVAL_NULL(key);
+ } else {
+ ZVAL_LONG(key, I->key);
}
- *int_key = I->key;
- return HASH_KEY_IS_LONG;
}
static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index f2e36c1719..2ae559571d 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -343,7 +343,6 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
long row_count;
- int ret;
PDO_DBG_ENTER("pdo_mysql_stmt_next_rowset");
PDO_DBG_INF_FMT("stmt=%p", S->stmt);
@@ -412,26 +411,21 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
S->result = NULL;
}
- ret = mysql_next_result(H->server);
+ if (!mysql_more_results(H->server)) {
+ /* No more results */
+ PDO_DBG_RETURN(0);
+ }
#if PDO_USE_MYSQLND
- /* for whatever reason mysqlnd breaks with libmysql compatibility at the C level, no -1 */
- if (PASS != ret) {
+ if (mysql_next_result(H->server) == FAIL) {
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);
- }
- if (mysql_more_results(H->server)) {
- PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
} else {
- /* No more results */
- PDO_DBG_RETURN(0);
+ PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
}
#else
- if (ret > 0) {
+ if (mysql_next_result(H->server) > 0) {
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);
- } else if (ret < 0) {
- /* No more results */
- PDO_DBG_RETURN(0);
} else {
PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
}
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index a6dd2c8146..94ffd3744b 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -1434,16 +1434,13 @@ struct _phar_t {
static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
{
zval **value;
- zend_uchar key_type;
zend_bool close_fp = 1;
- ulong int_key;
struct _phar_t *p_obj = (struct _phar_t*) puser;
uint str_key_len, base_len = p_obj->l, fname_len;
phar_entry_data *data;
php_stream *fp;
size_t contents_len;
char *fname, *error = NULL, *base = p_obj->b, *opened, *save = NULL, *temp = NULL;
- phar_zstr key;
char *str_key;
zend_class_entry *ce = p_obj->c;
phar_archive_object *phar_obj = p_obj->p;
@@ -1478,35 +1475,24 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
}
if (iter->funcs->get_current_key) {
- key_type = iter->funcs->get_current_key(iter, &key, &str_key_len, &int_key TSRMLS_CC);
+ zval key;
+ iter->funcs->get_current_key(iter, &key TSRMLS_CC);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
}
- if (key_type == HASH_KEY_IS_LONG) {
+ if (Z_TYPE(key) != IS_STRING) {
+ zval_dtor(&key);
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name);
return ZEND_HASH_APPLY_STOP;
}
- if (key_type > 9) { /* IS_UNICODE == 10 */
-#if PHP_VERSION_ID < 60000
-/* this can never happen, but fixes a compile warning */
- spprintf(&str_key, 0, "%s", key);
-#else
- spprintf(&str_key, 0, "%v", key);
- ezfree(key);
-#endif
- } else {
- PHAR_STR(key, str_key);
- }
+ str_key_len = Z_STRLEN(key);
+ str_key = estrndup(Z_STRVAL(key), str_key_len);
save = str_key;
-
- if (str_key[str_key_len - 1] == '\0') {
- str_key_len--;
- }
-
+ zval_dtor(&key);
} else {
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name);
return ZEND_HASH_APPLY_STOP;
@@ -1641,32 +1627,24 @@ phar_spl_fileinfo:
}
} else {
if (iter->funcs->get_current_key) {
- key_type = iter->funcs->get_current_key(iter, &key, &str_key_len, &int_key TSRMLS_CC);
+ zval key;
+ iter->funcs->get_current_key(iter, &key TSRMLS_CC);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
}
- if (key_type == HASH_KEY_IS_LONG) {
+ if (Z_TYPE(key) != IS_STRING) {
+ zval_dtor(&key);
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name);
return ZEND_HASH_APPLY_STOP;
}
- if (key_type > 9) { /* IS_UNICODE == 10 */
-#if PHP_VERSION_ID < 60000
-/* this can never happen, but fixes a compile warning */
- spprintf(&str_key, 0, "%s", key);
-#else
- spprintf(&str_key, 0, "%v", key);
- ezfree(key);
-#endif
- } else {
- PHAR_STR(key, str_key);
- }
+ str_key_len = Z_STRLEN(key);
+ str_key = estrndup(Z_STRVAL(key), str_key_len);
save = str_key;
-
- if (str_key[str_key_len - 1] == '\0') str_key_len--;
+ zval_dtor(&key);
} else {
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name);
return ZEND_HASH_APPLY_STOP;
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index baae3842c2..e7c2f29844 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -59,7 +59,7 @@ static zval *sxe_get_value(zval *z TSRMLS_DC);
static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC);
static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC);
static void php_sxe_iterator_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC);
-static int php_sxe_iterator_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
+static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC);
static void php_sxe_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC);
static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC);
@@ -2376,29 +2376,22 @@ static void php_sxe_iterator_current_data(zend_object_iterator *iter, zval ***da
}
/* }}} */
-static int php_sxe_iterator_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) /* {{{ */
+static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
{
- zval *curobj;
- xmlNodePtr curnode = NULL;
- php_sxe_object *intern;
- int namelen;
-
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
- curobj = iterator->sxe->iter.data;
+ zval *curobj = iterator->sxe->iter.data;
+ php_sxe_object *intern = (php_sxe_object *)zend_object_store_get_object(curobj TSRMLS_CC);
- intern = (php_sxe_object *)zend_object_store_get_object(curobj TSRMLS_CC);
+ xmlNodePtr curnode = NULL;
if (intern != NULL && intern->node != NULL) {
curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->node)->node;
}
- if (!curnode) {
- return HASH_KEY_NON_EXISTANT;
- }
-
- namelen = xmlStrlen(curnode->name);
- *str_key = estrndup((char *)curnode->name, namelen);
- *str_key_len = namelen + 1;
- return HASH_KEY_IS_STRING;
+ if (curnode) {
+ ZVAL_STRINGL(key, (char *) curnode->name, xmlStrlen(curnode->name), 1);
+ } else {
+ ZVAL_NULL(key);
+ }
}
/* }}} */
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 897956d91b..5cec3e558e 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -2313,10 +2313,6 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
zend_object_iterator *iter;
zend_class_entry *ce = Z_OBJCE_P(data);
zval **val;
- char *str_key;
- uint str_key_len;
- ulong int_key;
- int key_type;
ALLOC_ZVAL(array_copy);
INIT_PZVAL(array_copy);
@@ -2345,19 +2341,14 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
goto iterator_done;
}
if (iter->funcs->get_current_key) {
- key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
+ zval key;
+ iter->funcs->get_current_key(iter, &key TSRMLS_CC);
if (EG(exception)) {
goto iterator_done;
}
- switch(key_type) {
- case HASH_KEY_IS_STRING:
- add_assoc_zval_ex(array_copy, str_key, str_key_len, *val);
- efree(str_key);
- break;
- case HASH_KEY_IS_LONG:
- add_index_zval(array_copy, int_key, *val);
- break;
- }
+ array_set_zval_key(Z_ARRVAL_P(array_copy), &key, *val);
+ zval_ptr_dtor(val);
+ zval_dtor(&key);
} else {
add_next_index_zval(array_copy, *val);
}
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index e56a8f09e2..edeade3755 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -1018,20 +1018,20 @@ static void spl_array_it_get_current_data(zend_object_iterator *iter, zval ***da
}
/* }}} */
-static int spl_array_it_get_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) /* {{{ */
+static void spl_array_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
{
spl_array_it *iterator = (spl_array_it *)iter;
spl_array_object *object = iterator->object;
HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC);
if (object->ar_flags & SPL_ARRAY_OVERLOADED_KEY) {
- return zend_user_it_get_current_key(iter, str_key, str_key_len, int_key TSRMLS_CC);
+ zend_user_it_get_current_key(iter, key TSRMLS_CC);
} else {
if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::current(): " TSRMLS_CC) == FAILURE) {
- return HASH_KEY_NON_EXISTANT;
+ ZVAL_NULL(key);
+ } else {
+ zend_hash_get_current_key_zval_ex(aht, key, &object->pos);
}
-
- return zend_hash_get_current_key_ex(aht, str_key, str_key_len, int_key, 1, &object->pos);
}
}
/* }}} */
@@ -1547,25 +1547,13 @@ SPL_METHOD(Array, key)
void spl_array_iterator_key(zval *object, zval *return_value TSRMLS_DC) /* {{{ */
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
- char *string_key;
- uint string_length;
- ulong num_key;
HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) {
return;
}
- switch (zend_hash_get_current_key_ex(aht, &string_key, &string_length, &num_key, 1, &intern->pos)) {
- case HASH_KEY_IS_STRING:
- RETVAL_STRINGL(string_key, string_length - 1, 0);
- break;
- case HASH_KEY_IS_LONG:
- RETVAL_LONG(num_key);
- break;
- case HASH_KEY_NON_EXISTANT:
- return;
- }
+ zend_hash_get_current_key_zval_ex(aht, return_value, &intern->pos);
}
/* }}} */
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index f43a3709e1..cf653f6899 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -1621,7 +1621,7 @@ SPL_METHOD(GlobIterator, count)
static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC);
static int spl_filesystem_dir_it_valid(zend_object_iterator *iter TSRMLS_DC);
static void spl_filesystem_dir_it_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC);
-static int spl_filesystem_dir_it_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
+static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC);
static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC);
static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC);
@@ -1698,12 +1698,11 @@ static void spl_filesystem_dir_it_current_data(zend_object_iterator *iter, zval
/* }}} */
/* {{{ spl_filesystem_dir_it_current_key */
-static int spl_filesystem_dir_it_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
+static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
-
- *int_key = object->u.dir.index;
- return HASH_KEY_IS_LONG;
+
+ ZVAL_LONG(key, object->u.dir.index);
}
/* }}} */
@@ -1777,19 +1776,16 @@ static void spl_filesystem_tree_it_current_data(zend_object_iterator *iter, zval
/* }}} */
/* {{{ spl_filesystem_tree_it_current_key */
-static int spl_filesystem_tree_it_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
+static void spl_filesystem_tree_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
-
+
if (SPL_FILE_DIR_KEY(object, SPL_FILE_DIR_KEY_AS_FILENAME)) {
- *str_key_len = strlen(object->u.dir.entry.d_name) + 1;
- *str_key = estrndup(object->u.dir.entry.d_name, *str_key_len - 1);
+ ZVAL_STRING(key, object->u.dir.entry.d_name, 1);
} else {
spl_filesystem_object_get_file_name(object TSRMLS_CC);
- *str_key_len = object->file_name_len + 1;
- *str_key = estrndup(object->file_name, object->file_name_len);
+ ZVAL_STRINGL(key, object->file_name, object->file_name_len, 1);
}
- return HASH_KEY_IS_STRING;
}
/* }}} */
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index a8417feada..d8081efb26 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -1023,12 +1023,11 @@ static void spl_dllist_it_get_current_data(zend_object_iterator *iter, zval ***d
}
/* }}} */
-static int spl_dllist_it_get_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) /* {{{ */
+static void spl_dllist_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
{
spl_dllist_it *iterator = (spl_dllist_it *)iter;
- *int_key = (ulong) iterator->traverse_position;
- return HASH_KEY_IS_LONG;
+ ZVAL_LONG(key, iterator->traverse_position);
}
/* }}} */
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c
index fec7e2c4ac..86a5371ed3 100644
--- a/ext/spl/spl_fixedarray.c
+++ b/ext/spl/spl_fixedarray.c
@@ -948,18 +948,16 @@ static void spl_fixedarray_it_get_current_data(zend_object_iterator *iter, zval
}
/* }}} */
-static int spl_fixedarray_it_get_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
{
spl_fixedarray_it *iterator = (spl_fixedarray_it *)iter;
spl_fixedarray_object *intern = iterator->object;
if (intern->flags & SPL_FIXEDARRAY_OVERLOADED_KEY) {
- return zend_user_it_get_current_key(iter, str_key, str_key_len, int_key TSRMLS_CC);
+ zend_user_it_get_current_key(iter, key TSRMLS_CC);
} else {
- *int_key = (ulong) iterator->object->current;
- return HASH_KEY_IS_LONG;
+ ZVAL_LONG(key, iterator->object->current);
}
-
}
/* }}} */
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index d2de85b2a7..cb1f68dcf1 100644
--- a/ext/spl/spl_heap.c
+++ b/ext/spl/spl_heap.c
@@ -949,12 +949,11 @@ static void spl_pqueue_it_get_current_data(zend_object_iterator *iter, zval ***d
}
/* }}} */
-static int spl_heap_it_get_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) /* {{{ */
+static void spl_heap_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
{
spl_heap_it *iterator = (spl_heap_it *)iter;
- *int_key = (ulong) iterator->object->heap->count - 1;
- return HASH_KEY_IS_LONG;
+ ZVAL_LONG(key, iterator->object->heap->count - 1);
}
/* }}} */
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index 87b3763cfd..fcb4d20a63 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -190,16 +190,15 @@ static void spl_recursive_it_get_current_data(zend_object_iterator *iter, zval *
sub_iter->funcs->get_current_data(sub_iter, data TSRMLS_CC);
}
-static int spl_recursive_it_get_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
+static void spl_recursive_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
spl_recursive_it_object *object = (spl_recursive_it_object*)iter->data;
zend_object_iterator *sub_iter = object->iterators[object->level].iterator;
if (sub_iter->funcs->get_current_key) {
- return sub_iter->funcs->get_current_key(sub_iter, str_key, str_key_len, int_key TSRMLS_CC);
+ sub_iter->funcs->get_current_key(sub_iter, key TSRMLS_CC);
} else {
- *int_key = iter->index;
- return HASH_KEY_IS_LONG;
+ ZVAL_LONG(key, iter->index);
}
}
@@ -617,20 +616,7 @@ SPL_METHOD(RecursiveIteratorIterator, key)
}
if (iterator->funcs->get_current_key) {
- char *str_key;
- uint str_key_len;
- ulong int_key;
-
- switch (iterator->funcs->get_current_key(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;
- default:
- RETURN_NULL();
- }
+ iterator->funcs->get_current_key(iterator, return_value TSRMLS_CC);
} else {
RETURN_NULL();
}
@@ -1171,20 +1157,7 @@ SPL_METHOD(RecursiveTreeIterator, key)
}
if (iterator->funcs->get_current_key) {
- char *str_key;
- uint str_key_len;
- ulong int_key;
-
- switch (iterator->funcs->get_current_key(iterator, &str_key, &str_key_len, &int_key TSRMLS_CC)) {
- case HASH_KEY_IS_LONG:
- ZVAL_LONG(&key, int_key);
- break;
- case HASH_KEY_IS_STRING:
- ZVAL_STRINGL(&key, str_key, str_key_len-1, 0);
- break;
- default:
- ZVAL_NULL(&key);
- }
+ iterator->funcs->get_current_key(iterator, &key TSRMLS_CC);
} else {
ZVAL_NULL(&key);
}
@@ -1590,9 +1563,9 @@ static inline void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
zval_ptr_dtor(&intern->current.data);
intern->current.data = NULL;
}
- if (intern->current.str_key) {
- efree(intern->current.str_key);
- intern->current.str_key = NULL;
+ if (intern->current.key) {
+ zval_ptr_dtor(&intern->current.key);
+ intern->current.key = NULL;
}
if (intern->dit_type == DIT_CachingIterator || intern->dit_type == DIT_RecursiveCachingIterator) {
if (intern->u.caching.zstr) {
@@ -1635,11 +1608,16 @@ static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more T
intern->current.data = *data;
Z_ADDREF_P(intern->current.data);
}
+
+ MAKE_STD_ZVAL(intern->current.key);
if (intern->inner.iterator->funcs->get_current_key) {
- intern->current.key_type = intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, &intern->current.str_key, &intern->current.str_key_len, &intern->current.int_key TSRMLS_CC);
+ intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, intern->current.key TSRMLS_CC);
+ if (EG(exception)) {
+ zval_ptr_dtor(&intern->current.key);
+ intern->current.key = NULL;
+ }
} else {
- intern->current.key_type = HASH_KEY_IS_LONG;
- intern->current.int_key = intern->current.pos;
+ ZVAL_LONG(intern->current.key, intern->current.pos);
}
return EG(exception) ? FAILURE : SUCCESS;
}
@@ -1711,12 +1689,8 @@ SPL_METHOD(dual_it, key)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- if (intern->current.data) {
- if (intern->current.key_type == HASH_KEY_IS_STRING) {
- RETURN_STRINGL(intern->current.str_key, intern->current.str_key_len-1, 1);
- } else {
- RETURN_LONG(intern->current.int_key);
- }
+ if (intern->current.key) {
+ RETURN_ZVAL(intern->current.key, 1, 0);
}
RETURN_NULL();
} /* }}} */
@@ -1927,27 +1901,18 @@ SPL_METHOD(CallbackFilterIterator, accept)
zend_fcall_info *fci = &intern->u.cbfilter->fci;
zend_fcall_info_cache *fcc = &intern->u.cbfilter->fcc;
zval **params[3];
- zval zkey;
- zval *zkey_p = &zkey;
zval *result;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if (intern->current.data == NULL) {
+ if (intern->current.data == NULL || intern->current.key == NULL) {
RETURN_FALSE;
}
-
- INIT_PZVAL(&zkey);
- if (intern->current.key_type == HASH_KEY_IS_LONG) {
- ZVAL_LONG(&zkey, intern->current.int_key);
- } else {
- ZVAL_STRINGL(&zkey, intern->current.str_key, intern->current.str_key_len-1, 0);
- }
params[0] = &intern->current.data;
- params[1] = &zkey_p;
+ params[1] = &intern->current.key;
params[2] = &intern->inner.zobject;
fci->retval_ptr_ptr = &result;
@@ -1971,9 +1936,9 @@ SPL_METHOD(CallbackFilterIterator, accept)
SPL_METHOD(RegexIterator, accept)
{
spl_dual_it_object *intern;
- char *subject, tmp[32], *result;
+ char *subject, *result;
int subject_len, use_copy, count = 0, result_len;
- zval subject_copy, zcount, *replacement, tmp_replacement;
+ zval *subject_ptr, subject_copy, zcount, *replacement, tmp_replacement;
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -1986,24 +1951,18 @@ SPL_METHOD(RegexIterator, accept)
}
if (intern->u.regex.flags & REGIT_USE_KEY) {
- if (intern->current.key_type == HASH_KEY_IS_LONG) {
- subject_len = slprintf(tmp, sizeof(tmp), "%ld", intern->current.int_key);
- subject = &tmp[0];
- use_copy = 0;
- } else {
- subject_len = intern->current.str_key_len - 1;
- subject = estrndup(intern->current.str_key, subject_len);
- use_copy = 1;
- }
+ subject_ptr = intern->current.key;
} else {
- zend_make_printable_zval(intern->current.data, &subject_copy, &use_copy);
- if (use_copy) {
- subject = Z_STRVAL(subject_copy);
- subject_len = Z_STRLEN(subject_copy);
- } else {
- subject = Z_STRVAL_P(intern->current.data);
- subject_len = Z_STRLEN_P(intern->current.data);
- }
+ subject_ptr = intern->current.data;
+ }
+
+ zend_make_printable_zval(subject_ptr, &subject_copy, &use_copy);
+ if (use_copy) {
+ subject = Z_STRVAL(subject_copy);
+ subject_len = Z_STRLEN(subject_copy);
+ } else {
+ subject = Z_STRVAL_P(subject_ptr);
+ subject_len = Z_STRLEN_P(subject_ptr);
}
switch (intern->u.regex.mode)
@@ -2051,12 +2010,9 @@ SPL_METHOD(RegexIterator, accept)
result = php_pcre_replace_impl(intern->u.regex.pce, subject, subject_len, replacement, 0, &result_len, -1, &count TSRMLS_CC);
if (intern->u.regex.flags & REGIT_USE_KEY) {
- if (intern->current.key_type != HASH_KEY_IS_LONG) {
- efree(intern->current.str_key);
- }
- intern->current.key_type = HASH_KEY_IS_STRING;
- intern->current.str_key = result;
- intern->current.str_key_len = result_len + 1;
+ zval_ptr_dtor(&intern->current.key);
+ MAKE_STD_ZVAL(intern->current.key);
+ ZVAL_STRINGL(intern->current.key, result, result_len, 0);
} else {
zval_ptr_dtor(&intern->current.data);
MAKE_STD_ZVAL(intern->current.data);
@@ -2590,14 +2546,14 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
/* Full cache ? */
if (intern->u.caching.flags & CIT_FULL_CACHE) {
zval *zcacheval;
+ zval *key = intern->current.key;
MAKE_STD_ZVAL(zcacheval);
ZVAL_ZVAL(zcacheval, intern->current.data, 1, 0);
- if (intern->current.key_type == HASH_KEY_IS_LONG) {
- add_index_zval(intern->u.caching.zcache, intern->current.int_key, zcacheval);
- } else {
- zend_symtable_update(HASH_OF(intern->u.caching.zcache), intern->current.str_key, intern->current.str_key_len, &zcacheval, sizeof(void*), NULL);
- }
+
+ array_set_zval_key(HASH_OF(intern->u.caching.zcache), key, zcacheval);
+
+ zval_ptr_dtor(&zcacheval);
}
/* Recursion ? */
if (intern->dit_type == DIT_RecursiveCachingIterator) {
@@ -2755,13 +2711,9 @@ SPL_METHOD(CachingIterator, __toString)
return;
}
if (intern->u.caching.flags & CIT_TOSTRING_USE_KEY) {
- if (intern->current.key_type == HASH_KEY_IS_STRING) {
- RETURN_STRINGL(intern->current.str_key, intern->current.str_key_len-1, 1);
- } else {
- RETVAL_LONG(intern->current.int_key);
- convert_to_string(return_value);
- return;
- }
+ MAKE_COPY_ZVAL(&intern->current.key, return_value);
+ convert_to_string(return_value);
+ return;
} else if (intern->u.caching.flags & CIT_TOSTRING_USE_CURRENT) {
MAKE_COPY_ZVAL(&intern->current.data, return_value);
convert_to_string(return_value);
@@ -3123,19 +3075,7 @@ SPL_METHOD(NoRewindIterator, key)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (intern->inner.iterator->funcs->get_current_key) {
- char *str_key;
- uint str_key_len;
- ulong int_key;
- switch (intern->inner.iterator->funcs->get_current_key(intern->inner.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;
- default:
- RETURN_NULL();
- }
+ intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, return_value TSRMLS_CC);
} else {
RETURN_NULL();
}
@@ -3502,11 +3442,7 @@ done:
static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
{
- zval **data, *return_value = (zval*)puser;
- char *str_key;
- uint str_key_len;
- ulong int_key;
- int key_type;
+ zval **data, *return_value = (zval*)puser;
iter->funcs->get_current_data(iter, &data TSRMLS_CC);
if (EG(exception)) {
@@ -3516,20 +3452,13 @@ static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser T
return ZEND_HASH_APPLY_STOP;
}
if (iter->funcs->get_current_key) {
- key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
+ zval key;
+ iter->funcs->get_current_key(iter, &key TSRMLS_CC);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
}
- Z_ADDREF_PP(data);
- switch(key_type) {
- case HASH_KEY_IS_STRING:
- add_assoc_zval_ex(return_value, str_key, str_key_len, *data);
- efree(str_key);
- break;
- case HASH_KEY_IS_LONG:
- add_index_zval(return_value, int_key, *data);
- break;
- }
+ array_set_zval_key(Z_ARRVAL_P(return_value), &key, *data);
+ zval_dtor(&key);
} else {
Z_ADDREF_PP(data);
add_next_index_zval(return_value, *data);
diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h
index 39cc0d1337..73d9d2e614 100644
--- a/ext/spl/spl_iterators.h
+++ b/ext/spl/spl_iterators.h
@@ -133,10 +133,7 @@ typedef struct _spl_dual_it_object {
} inner;
struct {
zval *data;
- char *str_key;
- uint str_key_len;
- ulong int_key;
- int key_type; /* HASH_KEY_IS_STRING or HASH_KEY_IS_LONG */
+ zval *key;
int pos;
} current;
dual_it_type dit_type;
diff --git a/ext/spl/tests/iterator_to_array_nonscalar_keys.phpt b/ext/spl/tests/iterator_to_array_nonscalar_keys.phpt
new file mode 100644
index 0000000000..a4cbcc3298
--- /dev/null
+++ b/ext/spl/tests/iterator_to_array_nonscalar_keys.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Tests iterator_to_array() with non-scalar keys
+--FILE--
+<?php
+
+function gen() {
+ yield "foo" => 0;
+ yield 1 => 1;
+ yield 2.5 => 2;
+ yield null => 3;
+ yield [] => 4;
+ yield new stdClass => 5;
+}
+
+var_dump(iterator_to_array(gen()));
+
+?>
+--EXPECTF--
+Warning: Illegal offset type in %s on line %d
+
+Warning: Illegal offset type in %s on line %d
+array(4) {
+ ["foo"]=>
+ int(0)
+ [1]=>
+ int(1)
+ [0]=>
+ int(2)
+ [""]=>
+ int(3)
+}
diff --git a/ext/spl/tests/multiple_iterator_001.phpt b/ext/spl/tests/multiple_iterator_001.phpt
index edd03f5040..eb77f79371 100644
--- a/ext/spl/tests/multiple_iterator_001.phpt
+++ b/ext/spl/tests/multiple_iterator_001.phpt
@@ -23,8 +23,8 @@ echo "-- Default flags, MultipleIterator::MIT_NEED_ALL | MultipleIterator::MIT_K
var_dump($m->getFlags() === (MultipleIterator::MIT_NEED_ALL | MultipleIterator::MIT_KEYS_NUMERIC));
-foreach($m as $value) {
- var_dump($m->key(), $value);
+foreach($m as $key => $value) {
+ var_dump($key, $value);
}
try {
$m->current();
@@ -42,8 +42,8 @@ echo "-- Flags = MultipleIterator::MIT_NEED_ANY | MultipleIterator::MIT_KEYS_NUM
$m->setFlags(MultipleIterator::MIT_NEED_ANY | MultipleIterator::MIT_KEYS_NUMERIC);
var_dump($m->getFlags() === (MultipleIterator::MIT_NEED_ANY | MultipleIterator::MIT_KEYS_NUMERIC));
-foreach($m as $value) {
- var_dump($m->key(), $value);
+foreach($m as $key => $value) {
+ var_dump($key, $value);
}
echo "-- Default flags, added element --\n";
@@ -51,8 +51,8 @@ echo "-- Default flags, added element --\n";
$m->setFlags(MultipleIterator::MIT_NEED_ALL | MultipleIterator::MIT_KEYS_NUMERIC);
$iter2[] = 3;
-foreach($m as $value) {
- var_dump($m->key(), $value);
+foreach($m as $key => $value) {
+ var_dump($key, $value);
}
echo "-- Flags |= MultipleIterator::MIT_KEYS_ASSOC, with iterator associated with NULL --\n";
@@ -71,8 +71,8 @@ $m->attachIterator($iter1, "iter1");
$m->attachIterator($iter2, b"iter2");
$m->attachIterator($iter3, 3);
-foreach($m as $value) {
- var_dump($m->key(), $value);
+foreach($m as $key => $value) {
+ var_dump($key, $value);
}
echo "-- Associate with invalid value --\n";
@@ -98,8 +98,8 @@ var_dump($m->containsIterator($iter2));
var_dump($m->detachIterator($iter2));
var_dump($m->countIterators());
var_dump($m->containsIterator($iter2));
-foreach($m as $value) {
- var_dump($m->key(), $value);
+foreach($m as $key => $value) {
+ var_dump($key, $value);
}
?>
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 40a27c0536..54077cd734 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -927,24 +927,12 @@ PHP_FUNCTION(current)
PHP_FUNCTION(key)
{
HashTable *array;
- char *string_key;
- uint string_length;
- ulong num_key;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H", &array) == FAILURE) {
return;
}
- switch (zend_hash_get_current_key_ex(array, &string_key, &string_length, &num_key, 0, NULL)) {
- case HASH_KEY_IS_STRING:
- RETVAL_STRINGL(string_key, string_length - 1, 1);
- break;
- case HASH_KEY_IS_LONG:
- RETVAL_LONG(num_key);
- break;
- case HASH_KEY_NON_EXISTANT:
- return;
- }
+ zend_hash_get_current_key_zval(array, return_value);
}
/* }}} */
@@ -1055,9 +1043,6 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive
zval **args[3], /* Arguments to userland function */
*retval_ptr, /* Return value - unused */
*key=NULL; /* Entry key */
- char *string_key;
- uint string_key_len;
- ulong num_key;
/* Set up known arguments */
args[1] = &key;
@@ -1103,17 +1088,7 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive
} else {
/* Allocate space for key */
MAKE_STD_ZVAL(key);
-
- /* Set up the key */
- switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_key_len, &num_key, 0, NULL)) {
- case HASH_KEY_IS_LONG:
- Z_TYPE_P(key) = IS_LONG;
- Z_LVAL_P(key) = num_key;
- break;
- case HASH_KEY_IS_STRING:
- ZVAL_STRINGL(key, string_key, string_key_len - 1, 1);
- break;
- }
+ zend_hash_get_current_key_zval(target_hash, key);
/* Call the userland function */
if (zend_call_function(&BG(array_walk_fci), &BG(array_walk_fci_cache) TSRMLS_CC) == SUCCESS) {
@@ -1205,9 +1180,6 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) /* {{{
res; /* comparison result */
HashPosition pos; /* hash iterator */
zend_bool strict = 0; /* strict comparison or not */
- ulong num_key;
- uint str_key_len;
- char *string_key;
int (*is_equal_func)(zval *, zval *, zval * TSRMLS_DC) = is_equal_function;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "za|b", &value, &array, &strict) == FAILURE) {
@@ -1225,15 +1197,8 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) /* {{{
if (behavior == 0) {
RETURN_TRUE;
} else {
- /* Return current key */
- switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(array), &string_key, &str_key_len, &num_key, 0, &pos)) {
- case HASH_KEY_IS_STRING:
- RETURN_STRINGL(string_key, str_key_len - 1, 1);
- break;
- case HASH_KEY_IS_LONG:
- RETURN_LONG(num_key);
- break;
- }
+ zend_hash_get_current_key_zval_ex(Z_ARRVAL_P(array), return_value, &pos);
+ return;
}
}
zend_hash_move_forward_ex(Z_ARRVAL_P(array), &pos);
@@ -2447,9 +2412,6 @@ PHP_FUNCTION(array_keys)
res, /* Result of comparison */
*new_val; /* New value */
int add_key; /* Flag to indicate whether a key should be added */
- char *string_key; /* String key */
- uint string_key_len;
- ulong num_key; /* Numeric key */
zend_bool strict = 0; /* do strict comparison */
HashPosition pos;
int (*is_equal_func)(zval *, zval *, zval * TSRMLS_DC) = is_equal_function;
@@ -2480,19 +2442,8 @@ PHP_FUNCTION(array_keys)
if (add_key) {
MAKE_STD_ZVAL(new_val);
-
- switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(input), &string_key, &string_key_len, &num_key, 1, &pos)) {
- case HASH_KEY_IS_STRING:
- ZVAL_STRINGL(new_val, string_key, string_key_len - 1, 0);
- zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &new_val, sizeof(zval *), NULL);
- break;
-
- case HASH_KEY_IS_LONG:
- Z_TYPE_P(new_val) = IS_LONG;
- Z_LVAL_P(new_val) = num_key;
- zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &new_val, sizeof(zval *), NULL);
- break;
- }
+ zend_hash_get_current_key_zval_ex(Z_ARRVAL_P(input), new_val, &pos);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &new_val, sizeof(zval *), NULL);
}
zend_hash_move_forward_ex(Z_ARRVAL_P(input), &pos);
@@ -2691,9 +2642,6 @@ PHP_FUNCTION(array_pad)
PHP_FUNCTION(array_flip)
{
zval *array, **entry, *data;
- char *string_key;
- uint str_key_len;
- ulong num_key;
HashPosition pos;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
@@ -2705,15 +2653,7 @@ PHP_FUNCTION(array_flip)
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(array), &pos);
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(array), (void **)&entry, &pos) == SUCCESS) {
MAKE_STD_ZVAL(data);
- switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(array), &string_key, &str_key_len, &num_key, 1, &pos)) {
- case HASH_KEY_IS_STRING:
- ZVAL_STRINGL(data, string_key, str_key_len - 1, 0);
- break;
- case HASH_KEY_IS_LONG:
- Z_TYPE_P(data) = IS_LONG;
- Z_LVAL_P(data) = num_key;
- break;
- }
+ zend_hash_get_current_key_zval_ex(Z_ARRVAL_P(array), data, &pos);
if (Z_TYPE_PP(entry) == IS_LONG) {
zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_PP(entry), &data, sizeof(data), NULL);
diff --git a/ext/standard/tests/bug64370_var1.phpt b/ext/standard/tests/bug64370_var1.phpt
new file mode 100644
index 0000000000..aca46a594d
--- /dev/null
+++ b/ext/standard/tests/bug64370_var1.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Test bug #64370 microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT']
+--FILE--
+<?php
+echo "\$_SERVER['REQUEST_TIME']: {$_SERVER['REQUEST_TIME']}\n";
+echo "\$_SERVER['REQUEST_TIME_FLOAT']: {$_SERVER['REQUEST_TIME_FLOAT']}\n";
+echo "time(): " . time() . "\n";
+echo "microtime(true): " . microtime(true) . "\n";
+$d = (microtime(true)-$_SERVER['REQUEST_TIME_FLOAT'])*1000;
+echo "created in $d ms\n";
+echo ((bool)($d >= 0)) . "\n";
+?>
+===DONE===
+--EXPECTF--
+$_SERVER['REQUEST_TIME']: %d
+$_SERVER['REQUEST_TIME_FLOAT']: %f
+time(): %d
+microtime(true): %f
+created in %f ms
+1
+===DONE===
diff --git a/ext/standard/tests/bug64370_var2.phpt b/ext/standard/tests/bug64370_var2.phpt
new file mode 100644
index 0000000000..d0d3590ea7
--- /dev/null
+++ b/ext/standard/tests/bug64370_var2.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Test bug #64370 sequential microtime(true) calls
+--FILE--
+<?php
+
+$i = 0;
+while(100000 > $i++) {
+ $m0 = microtime(true);
+ $m1 = microtime(true);
+ $d = $m1 - $m0;
+
+ /*echo "$d\n";*/
+
+ if ($d < 0) {
+ die("failed in {$i}th iteration");
+ }
+}
+echo "ok\n";
+?>
+===DONE===
+--EXPECT--
+ok
+===DONE===
diff --git a/win32/globals.c b/win32/globals.c
index 1bbb3b4481..b381cc1237 100644
--- a/win32/globals.c
+++ b/win32/globals.c
@@ -65,8 +65,6 @@ PHP_RSHUTDOWN_FUNCTION(win32_core_globals)
;
closelog();
- wg->starttime.tv_sec = 0;
- wg->lasttime = 0;
return SUCCESS;
}
diff --git a/win32/php_win32_globals.h b/win32/php_win32_globals.h
index 1686e5df63..b2b07f68e1 100644
--- a/win32/php_win32_globals.h
+++ b/win32/php_win32_globals.h
@@ -38,10 +38,6 @@ struct _php_win32_core_globals {
char *log_header;
HANDLE log_source;
- /* time */
- struct timeval starttime;
- __int64 lasttime, freq;
-
HKEY registry_key;
HANDLE registry_event;
HashTable *registry_directories;
diff --git a/win32/time.c b/win32/time.c
index 391a8a81e9..77e4504cd1 100644
--- a/win32/time.c
+++ b/win32/time.c
@@ -12,13 +12,6 @@
/* $Id$ */
- /**
- *
- * 04-Feb-2001
- * - Added patch by "Vanhanen, Reijo" <Reijo.Vanhanen@helsoft.fi>
- * Improves accuracy of msec
- */
-
/* Include stuff ************************************************************ */
#include <config.w32.h>
@@ -32,98 +25,56 @@
#include <errno.h>
#include "php_win32_globals.h"
-int getfilesystemtime(struct timeval *time_Info)
+typedef VOID (WINAPI *MyGetSystemTimeAsFileTime)(LPFILETIME lpSystemTimeAsFileTime);
+
+static MyGetSystemTimeAsFileTime get_time_func(void)
{
- FILETIME ft;
- __int64 ff;
- ULARGE_INTEGER convFromft;
-
- GetSystemTimeAsFileTime(&ft); /* 100 ns blocks since 01-Jan-1641 */
- /* resolution seems to be 0.01 sec */
- /*
- * Do not cast a pointer to a FILETIME structure to either a
- * ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows.
- * via http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx
- */
- convFromft.HighPart = ft.dwHighDateTime;
- convFromft.LowPart = ft.dwLowDateTime;
- ff = convFromft.QuadPart;
-
- time_Info->tv_sec = (int)(ff/(__int64)10000000-(__int64)11644473600);
- time_Info->tv_usec = (int)(ff % 10000000)/10;
- return 0;
+ MyGetSystemTimeAsFileTime timefunc = NULL;
+ HMODULE hMod = LoadLibrary("kernel32.dll");
+
+ if (hMod) {
+ /* Max possible resolution <1us, win8/server2012 */
+ timefunc = (MyGetSystemTimeAsFileTime)GetProcAddress(hMod, "GetSystemTimePreciseAsFileTime");
+
+ if(!timefunc) {
+ /* 100ns blocks since 01-Jan-1641 */
+ timefunc = (MyGetSystemTimeAsFileTime)GetProcAddress(hMod, "GetSystemTimeAsFileTime");
+ }
+ }
+
+ return timefunc;
}
-
+int getfilesystemtime(struct timeval *tv)
+{
+ FILETIME ft;
+ unsigned __int64 ff = 0;
+ MyGetSystemTimeAsFileTime timefunc;
+
+ timefunc = get_time_func();
+ if (timefunc) {
+ timefunc(&ft);
+ } else {
+ GetSystemTimeAsFileTime(&ft);
+ }
+
+ ff |= ft.dwHighDateTime;
+ ff <<= 32;
+ ff |= ft.dwLowDateTime;
+ ff /= 10; /* convert to microseconds */
+ ff -= 11644473600000000Ui64; /* convert to unix epoch */
+
+ tv->tv_sec = (long)(ff / 1000000UL);
+ tv->tv_usec = (long)(ff % 1000000UL);
+
+ return 0;
+}
PHPAPI int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info)
{
- __int64 timer;
- LARGE_INTEGER li;
- BOOL b;
- double dt;
- TSRMLS_FETCH();
-
/* Get the time, if they want it */
if (time_Info != NULL) {
- if (PW32G(starttime).tv_sec == 0) {
- b = QueryPerformanceFrequency(&li);
- if (!b) {
- PW32G(starttime).tv_sec = -1;
- }
- else {
- PW32G(freq) = li.QuadPart;
- b = QueryPerformanceCounter(&li);
- if (!b) {
- PW32G(starttime).tv_sec = -1;
- }
- else {
- getfilesystemtime(&PW32G(starttime));
- timer = li.QuadPart;
- dt = (double)timer/PW32G(freq);
- PW32G(starttime).tv_usec -= (int)((dt-(int)dt)*1000000);
- if (PW32G(starttime).tv_usec < 0) {
- PW32G(starttime).tv_usec += 1000000;
- --PW32G(starttime).tv_sec;
- }
- PW32G(starttime).tv_sec -= (int)dt;
- }
- }
- }
- if (PW32G(starttime).tv_sec > 0) {
- b = QueryPerformanceCounter(&li);
- if (!b) {
- PW32G(starttime).tv_sec = -1;
- }
- else {
- timer = li.QuadPart;
- if (timer < PW32G(lasttime)) {
- getfilesystemtime(time_Info);
- dt = (double)timer/PW32G(freq);
- PW32G(starttime) = *time_Info;
- PW32G(starttime).tv_usec -= (int)((dt-(int)dt)*1000000);
- if (PW32G(starttime).tv_usec < 0) {
- PW32G(starttime).tv_usec += 1000000;
- --PW32G(starttime).tv_sec;
- }
- PW32G(starttime).tv_sec -= (int)dt;
- }
- else {
- PW32G(lasttime) = timer;
- dt = (double)timer/PW32G(freq);
- time_Info->tv_sec = PW32G(starttime).tv_sec + (int)dt;
- time_Info->tv_usec = PW32G(starttime).tv_usec + (int)((dt-(int)dt)*1000000);
- if (time_Info->tv_usec >= 1000000) {
- time_Info->tv_usec -= 1000000;
- ++time_Info->tv_sec;
- }
- }
- }
- }
- if (PW32G(starttime).tv_sec < 0) {
- getfilesystemtime(time_Info);
- }
-
+ getfilesystemtime(time_Info);
}
/* Get the timezone, if they want it */
if (timezone_Info != NULL) {