Fix object true value: if we are in compat mode and it's Zend object -

use PHP4 rules. Otherwise, object is always true.
This commit is contained in:
Stanislav Malyshev 2004-03-04 13:06:02 +00:00
parent 39ac9579f7
commit f9c65203d2

View file

@ -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;