From: Stanislav Malyshev Date: Thu, 4 Mar 2004 13:06:02 +0000 (+0000) Subject: Fix object true value: if we are in compat mode and it's Zend object - X-Git-Tag: RELEASE_0_2_0~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f9c65203d27ffede485c271a54e65ea7ea76a7fb;p=php Fix object true value: if we are in compat mode and it's Zend object - use PHP4 rules. Otherwise, object is always true. --- diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index ce7a99abb6..80666fc46d 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -93,8 +93,12 @@ static inline int i_zend_is_true(zval *op) result = (zend_hash_num_elements(op->value.ht)?1:0); break; case IS_OBJECT: - /* OBJ-TBI */ - result = 1; + if(EG(ze1_compatibility_mode) && IS_ZEND_STD_OBJECT(z)) { + TSRMLS_FETCH(); + result = (zend_hash_num_elements(Z_OBJPROP_PP(struc))?1:0); + } else { + result = 1; + } break; default: result = 0;