Browse Source

Introduce convert_to_*_ex()

experimetnal/RETURN_REF_PATCH
Zeev Suraski 27 years ago
parent
commit
52e769d883
  1. 40
      Zend/zend_operators.h

40
Zend/zend_operators.h

@ -70,4 +70,44 @@ ZEND_API int zend_binary_strcmp(zval *s1, zval *s2);
ZEND_API int zend_binary_strcasecmp(zval *s1, zval *s2);
ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
#define convert_to_long_ex(ppzv) \
if ((*ppzv)->type!=IS_LONG) { \
if (!(*ppzv)->EA.is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_long(*ppzv); \
}
#define convert_to_double_ex(ppzv) \
if ((*ppzv)->type!=IS_DOUBLE) { \
if (!(*ppzv)->EA.is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_double(*ppzv); \
}
#define convert_to_string_ex(ppzv) \
if ((*ppzv)->type!=IS_STRING) { \
if (!(*ppzv)->EA.is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_string(*ppzv); \
}
#define convert_to_array_ex(ppzv) \
if ((*ppzv)->type!=IS_ARRAY) { \
if (!(*ppzv)->EA.is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_array(*ppzv); \
}
#define convert_to_object_ex(ppzv) \
if ((*ppzv)->type!=IS_OBJECT) { \
if (!(*ppzv)->EA.is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_object(*ppzv); \
}
#endif
Loading…
Cancel
Save