summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.h
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_execute.h')
-rw-r--r--Zend/zend_execute.h27
1 files changed, 10 insertions, 17 deletions
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index 02afc64c01..b3b084bd66 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -24,8 +24,8 @@
#include "zend_compile.h"
#include "zend_hash.h"
-#include "zend_variables.h"
#include "zend_operators.h"
+#include "zend_variables.h"
typedef union _temp_variable {
zval tmp_var;
@@ -73,28 +73,28 @@ static inline int i_zend_is_true(zval *op)
{
int result;
- switch (op->type) {
+ switch (Z_TYPE_P(op)) {
case IS_NULL:
result = 0;
break;
case IS_LONG:
case IS_BOOL:
case IS_RESOURCE:
- result = (op->value.lval?1:0);
+ result = (Z_LVAL_P(op)?1:0);
break;
case IS_DOUBLE:
- result = (op->value.dval ? 1 : 0);
+ result = (Z_DVAL_P(op) ? 1 : 0);
break;
case IS_STRING:
- if (op->value.str.len == 0
- || (op->value.str.len==1 && op->value.str.val[0]=='0')) {
+ if (Z_STRLEN_P(op) == 0
+ || (Z_STRLEN_P(op)==1 && Z_STRVAL_P(op)[0]=='0')) {
result = 0;
} else {
result = 1;
}
break;
case IS_ARRAY:
- result = (zend_hash_num_elements(op->value.ht)?1:0);
+ result = (zend_hash_num_elements(Z_ARRVAL_P(op))?1:0);
break;
case IS_OBJECT:
if(IS_ZEND_STD_OBJECT(*op)) {
@@ -102,7 +102,7 @@ static inline int i_zend_is_true(zval *op)
if (Z_OBJ_HT_P(op)->cast_object) {
zval tmp;
- if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_BOOL, 0 TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_BOOL TSRMLS_CC) == SUCCESS) {
result = Z_LVAL(tmp);
break;
}
@@ -116,15 +116,8 @@ static inline int i_zend_is_true(zval *op)
break;
}
}
-
- if(EG(ze1_compatibility_mode)) {
- result = (zend_hash_num_elements(Z_OBJPROP_P(op))?1:0);
- } else {
- result = 1;
- }
- } else {
- result = 1;
}
+ result = 1;
break;
default:
result = 0;
@@ -191,7 +184,7 @@ void zend_shutdown_timeout_thread();
/* The following tries to resolve the classname of a zval of type object.
* Since it is slow it should be only used in error messages.
*/
-#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && (zval)->type == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : "")
+#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && Z_TYPE_P(zval) == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : "")
ZEND_API zval** zend_get_compiled_variable_value(zend_execute_data *execute_data_ptr, zend_uint var);