Skip to content

Commit 4242098

Browse files
committed
fix #165
PHP 8.2 - msgpack_check_ht_is_map assertion error in ZEND_HASH_FOREACH_BUCKET
1 parent 0cd46b1 commit 4242098

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

msgpack_pack.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
#include "msgpack/pack_template.h"
2323

24+
#if PHP_VERSION_ID >= 80100
25+
# define msgpack_check_ht_is_map(array) (!zend_array_is_list(Z_ARRVAL_P(array)))
26+
#else
2427
static inline int msgpack_check_ht_is_map(zval *array) /* {{{ */ {
2528
Bucket *b;
2629
zend_ulong i = 0;
@@ -35,6 +38,7 @@ static inline int msgpack_check_ht_is_map(zval *array) /* {{{ */ {
3538
return 0;
3639
}
3740
/* }}} */
41+
#endif
3842

3943
static inline int msgpack_var_add(HashTable *var_hash, zval *var, zend_long *var_old) /* {{{ */ {
4044
uint32_t len;

0 commit comments

Comments
 (0)