From 9712a974beb53f47bcffb2c6554cc5c85d231fe2 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Mon, 21 Mar 2016 19:12:50 +0800 Subject: [PATCH] Also protects object to array cast --- Zend/zend_operators.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 5cbe393d14..50557e56d8 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -597,7 +597,9 @@ try_again: if (obj_ht) { zval arr; - if (!Z_OBJCE_P(op)->default_properties_count && obj_ht == Z_OBJ_P(op)->properties) { + if (!Z_OBJCE_P(op)->default_properties_count && + obj_ht == Z_OBJ_P(op)->properties && + !ZEND_HASH_GET_APPLY_COUNT(Z_OBJ_P(op)->properties)) { /* fast copy */ if (EXPECTED(Z_OBJ_P(op)->handlers == &std_object_handlers)) { ZVAL_ARR(&arr, obj_ht); -- 2.50.1