@@ -3251,7 +3251,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CONST_H
3251
3251
}
3252
3252
3253
3253
if (opline->extended_value == IS_ARRAY) {
3254
- if (Z_TYPE_P(expr) != IS_OBJECT) {
3254
+ if (IS_CONST == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure ) {
3255
3255
if (Z_TYPE_P(expr) != IS_NULL) {
3256
3256
ZVAL_ARR(result, zend_new_array(1));
3257
3257
expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
@@ -3263,6 +3263,18 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CONST_H
3263
3263
} else {
3264
3264
ZVAL_EMPTY_ARRAY(result);
3265
3265
}
3266
+ } else if (Z_OBJ_HT_P(expr)->get_properties) {
3267
+ HashTable *obj_ht = Z_OBJ_HT_P(expr)->get_properties(expr);
3268
+ if (obj_ht) {
3269
+ /* fast copy */
3270
+ obj_ht = zend_proptable_to_symtable(obj_ht,
3271
+ (Z_OBJCE_P(expr)->default_properties_count ||
3272
+ Z_OBJ_P(expr)->handlers != &std_object_handlers ||
3273
+ GC_IS_RECURSIVE(obj_ht)));
3274
+ ZVAL_ARR(result, obj_ht);
3275
+ } else {
3276
+ ZVAL_EMPTY_ARRAY(result);
3277
+ }
3266
3278
} else {
3267
3279
ZVAL_COPY_VALUE(result, expr);
3268
3280
Z_ADDREF_P(result);
@@ -18075,7 +18087,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPC
18075
18087
}
18076
18088
18077
18089
if (opline->extended_value == IS_ARRAY) {
18078
- if (Z_TYPE_P(expr) != IS_OBJECT) {
18090
+ if (IS_TMP_VAR == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure ) {
18079
18091
if (Z_TYPE_P(expr) != IS_NULL) {
18080
18092
ZVAL_ARR(result, zend_new_array(1));
18081
18093
expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
@@ -18087,6 +18099,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPC
18087
18099
} else {
18088
18100
ZVAL_EMPTY_ARRAY(result);
18089
18101
}
18102
+ } else if (Z_OBJ_HT_P(expr)->get_properties) {
18103
+ HashTable *obj_ht = Z_OBJ_HT_P(expr)->get_properties(expr);
18104
+ if (obj_ht) {
18105
+ /* fast copy */
18106
+ obj_ht = zend_proptable_to_symtable(obj_ht,
18107
+ (Z_OBJCE_P(expr)->default_properties_count ||
18108
+ Z_OBJ_P(expr)->handlers != &std_object_handlers ||
18109
+ GC_IS_RECURSIVE(obj_ht)));
18110
+ ZVAL_ARR(result, obj_ht);
18111
+ } else {
18112
+ ZVAL_EMPTY_ARRAY(result);
18113
+ }
18090
18114
} else {
18091
18115
ZVAL_COPY_VALUE(result, expr);
18092
18116
Z_ADDREF_P(result);
@@ -21118,7 +21142,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPC
21118
21142
}
21119
21143
21120
21144
if (opline->extended_value == IS_ARRAY) {
21121
- if (Z_TYPE_P(expr) != IS_OBJECT) {
21145
+ if (IS_VAR == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure ) {
21122
21146
if (Z_TYPE_P(expr) != IS_NULL) {
21123
21147
ZVAL_ARR(result, zend_new_array(1));
21124
21148
expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
@@ -21130,6 +21154,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPC
21130
21154
} else {
21131
21155
ZVAL_EMPTY_ARRAY(result);
21132
21156
}
21157
+ } else if (Z_OBJ_HT_P(expr)->get_properties) {
21158
+ HashTable *obj_ht = Z_OBJ_HT_P(expr)->get_properties(expr);
21159
+ if (obj_ht) {
21160
+ /* fast copy */
21161
+ obj_ht = zend_proptable_to_symtable(obj_ht,
21162
+ (Z_OBJCE_P(expr)->default_properties_count ||
21163
+ Z_OBJ_P(expr)->handlers != &std_object_handlers ||
21164
+ GC_IS_RECURSIVE(obj_ht)));
21165
+ ZVAL_ARR(result, obj_ht);
21166
+ } else {
21167
+ ZVAL_EMPTY_ARRAY(result);
21168
+ }
21133
21169
} else {
21134
21170
ZVAL_COPY_VALUE(result, expr);
21135
21171
Z_ADDREF_P(result);
@@ -37227,7 +37263,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCO
37227
37263
}
37228
37264
37229
37265
if (opline->extended_value == IS_ARRAY) {
37230
- if (Z_TYPE_P(expr) != IS_OBJECT) {
37266
+ if (IS_CV == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure ) {
37231
37267
if (Z_TYPE_P(expr) != IS_NULL) {
37232
37268
ZVAL_ARR(result, zend_new_array(1));
37233
37269
expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
@@ -37239,6 +37275,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCO
37239
37275
} else {
37240
37276
ZVAL_EMPTY_ARRAY(result);
37241
37277
}
37278
+ } else if (Z_OBJ_HT_P(expr)->get_properties) {
37279
+ HashTable *obj_ht = Z_OBJ_HT_P(expr)->get_properties(expr);
37280
+ if (obj_ht) {
37281
+ /* fast copy */
37282
+ obj_ht = zend_proptable_to_symtable(obj_ht,
37283
+ (Z_OBJCE_P(expr)->default_properties_count ||
37284
+ Z_OBJ_P(expr)->handlers != &std_object_handlers ||
37285
+ GC_IS_RECURSIVE(obj_ht)));
37286
+ ZVAL_ARR(result, obj_ht);
37287
+ } else {
37288
+ ZVAL_EMPTY_ARRAY(result);
37289
+ }
37242
37290
} else {
37243
37291
ZVAL_COPY_VALUE(result, expr);
37244
37292
Z_ADDREF_P(result);
0 commit comments