diff --git a/Zend/tests/gh10200.phpt b/Zend/tests/gh10200.phpt new file mode 100644 index 00000000000..5462352e7ae --- /dev/null +++ b/Zend/tests/gh10200.phpt @@ -0,0 +1,20 @@ +--TEST-- +GH-10200 (zif_get_object_vars: Assertion `!(((__ht)->u.flags & (1<<2)) != 0)' failed.) +--FILE-- + +https://github.com/php/php-src/issues/10200 not encountered +EOF; + +$xml = simplexml_load_string($xmlData); +$output = get_object_vars($xml); +var_dump($output); + +?> +--EXPECT-- +array(1) { + [0]=> + string(59) "https://github.com/php/php-src/issues/10200 not encountered" +} diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index b3103393b83..14ee4512d36 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -764,7 +764,7 @@ ZEND_FUNCTION(get_object_vars) } else { array_init_size(return_value, zend_hash_num_elements(properties)); - ZEND_HASH_MAP_FOREACH_KEY_VAL(properties, num_key, key, value) { + ZEND_HASH_FOREACH_KEY_VAL(properties, num_key, key, value) { bool is_dynamic = 1; if (Z_TYPE_P(value) == IS_INDIRECT) { value = Z_INDIRECT_P(value);