ZEND_API void ZEND_FASTCALL convert_to_null(zval *op) /* {{{ */
{
- if (Z_TYPE_P(op) == IS_OBJECT) {
- if (Z_OBJ_HT_P(op)->cast_object) {
- zval org;
-
- ZVAL_COPY_VALUE(&org, op);
- if (Z_OBJ_HT_P(op)->cast_object(&org, op, IS_NULL) == SUCCESS) {
- zval_dtor(&org);
- return;
- }
- ZVAL_COPY_VALUE(op, &org);
- }
- }
-
zval_ptr_dtor(op);
ZVAL_NULL(op);
}
switch (opline->extended_value) {
case IS_NULL:
- /* This code is taken from convert_to_null. However, it does not seems very useful,
- * because a conversion to null always results in the same value. This could only
- * be relevant if a cast_object handler for IS_NULL has some kind of side-effect. */
-#if 0
- if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) {
- ZVAL_DEREF(expr);
- }
- if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->cast_object) {
- if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL) == SUCCESS) {
- break;
- }
- }
-#endif
-
ZVAL_NULL(result);
break;
case _IS_BOOL:
switch (opline->extended_value) {
case IS_NULL:
- /* This code is taken from convert_to_null. However, it does not seems very useful,
- * because a conversion to null always results in the same value. This could only
- * be relevant if a cast_object handler for IS_NULL has some kind of side-effect. */
-#if 0
- if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
- ZVAL_DEREF(expr);
- }
- if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->cast_object) {
- if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL) == SUCCESS) {
- break;
- }
- }
-#endif
-
ZVAL_NULL(result);
break;
case _IS_BOOL:
switch (opline->extended_value) {
case IS_NULL:
- /* This code is taken from convert_to_null. However, it does not seems very useful,
- * because a conversion to null always results in the same value. This could only
- * be relevant if a cast_object handler for IS_NULL has some kind of side-effect. */
-#if 0
- if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
- ZVAL_DEREF(expr);
- }
- if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->cast_object) {
- if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL) == SUCCESS) {
- break;
- }
- }
-#endif
-
ZVAL_NULL(result);
break;
case _IS_BOOL:
switch (opline->extended_value) {
case IS_NULL:
- /* This code is taken from convert_to_null. However, it does not seems very useful,
- * because a conversion to null always results in the same value. This could only
- * be relevant if a cast_object handler for IS_NULL has some kind of side-effect. */
-#if 0
- if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
- ZVAL_DEREF(expr);
- }
- if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->cast_object) {
- if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL) == SUCCESS) {
- break;
- }
- }
-#endif
-
ZVAL_NULL(result);
break;
case _IS_BOOL:
switch (opline->extended_value) {
case IS_NULL:
- /* This code is taken from convert_to_null. However, it does not seems very useful,
- * because a conversion to null always results in the same value. This could only
- * be relevant if a cast_object handler for IS_NULL has some kind of side-effect. */
-#if 0
- if (IS_CV == IS_VAR || IS_CV == IS_CV) {
- ZVAL_DEREF(expr);
- }
- if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->cast_object) {
- if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL) == SUCCESS) {
- break;
- }
- }
-#endif
-
ZVAL_NULL(result);
break;
case _IS_BOOL: