@@ -143,13 +143,6 @@ ZEND_API zend_long ZEND_FASTCALL zend_atol(const char *str, size_t str_len) /* {
143
143
"Object of class %s could not be converted to %s", ZSTR_VAL(Z_OBJCE_P(op)->name),\
144
144
zend_get_type_by_const(ctype)); \
145
145
} \
146
- } else if (Z_OBJ_HT_P(op)->get) { \
147
- zval *newop = Z_OBJ_HT_P(op)->get(Z_OBJ_P(op), dst); \
148
- if (Z_TYPE_P(newop) != IS_OBJECT) { \
149
- /* for safety - avoid loop */ \
150
- ZVAL_COPY_VALUE (dst , newop ); \
151
- conv_func (dst ); \
152
- } \
153
146
}
154
147
155
148
/* }}} */
@@ -866,14 +859,6 @@ ZEND_API zend_string* ZEND_FASTCALL zval_get_string_func(zval *op) /* {{{ */
866
859
if (Z_OBJ_HT_P (op )-> cast_object (Z_OBJ_P (op ), & tmp , IS_STRING ) == SUCCESS ) {
867
860
return Z_STR (tmp );
868
861
}
869
- } else if (Z_OBJ_HT_P (op )-> get ) {
870
- zval * z = Z_OBJ_HT_P (op )-> get (Z_OBJ_P (op ), & tmp );
871
- if (Z_TYPE_P (z ) != IS_OBJECT ) {
872
- zend_string * str = zval_get_string (z );
873
- zval_ptr_dtor (z );
874
- return str ;
875
- }
876
- zval_ptr_dtor (z );
877
862
}
878
863
zend_error (EG (exception ) ? E_ERROR : E_RECOVERABLE_ERROR , "Object of class %s could not be converted to string" , ZSTR_VAL (Z_OBJCE_P (op )-> name ));
879
864
return ZSTR_EMPTY_ALLOC ();
@@ -1969,8 +1954,7 @@ ZEND_API int ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2)
1969
1954
{
1970
1955
int ret ;
1971
1956
int converted = 0 ;
1972
- zval op1_copy , op2_copy ;
1973
- zval * op_free , tmp_free ;
1957
+ zval op1_copy , op2_copy , tmp_free ;
1974
1958
1975
1959
while (1 ) {
1976
1960
switch (TYPE_PAIR (Z_TYPE_P (op1 ), Z_TYPE_P (op2 ))) {
@@ -2076,13 +2060,7 @@ ZEND_API int ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2)
2076
2060
}
2077
2061
}
2078
2062
if (Z_TYPE_P (op1 ) == IS_OBJECT ) {
2079
- if (Z_OBJ_HT_P (op1 )-> get ) {
2080
- zval rv ;
2081
- op_free = Z_OBJ_HT_P (op1 )-> get (Z_OBJ_P (op1 ), & rv );
2082
- ret = compare_function (result , op_free , op2 );
2083
- zend_free_obj_get_result (op_free );
2084
- return ret ;
2085
- } else if (Z_TYPE_P (op2 ) != IS_OBJECT && Z_OBJ_HT_P (op1 )-> cast_object ) {
2063
+ if (Z_TYPE_P (op2 ) != IS_OBJECT && Z_OBJ_HT_P (op1 )-> cast_object ) {
2086
2064
ZVAL_UNDEF (& tmp_free );
2087
2065
if (Z_OBJ_HT_P (op1 )-> cast_object (Z_OBJ_P (op1 ), & tmp_free , ((Z_TYPE_P (op2 ) == IS_FALSE || Z_TYPE_P (op2 ) == IS_TRUE ) ? _IS_BOOL : Z_TYPE_P (op2 ))) == FAILURE ) {
2088
2066
ZVAL_LONG (result , 1 );
@@ -2095,13 +2073,7 @@ ZEND_API int ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2)
2095
2073
}
2096
2074
}
2097
2075
if (Z_TYPE_P (op2 ) == IS_OBJECT ) {
2098
- if (Z_OBJ_HT_P (op2 )-> get ) {
2099
- zval rv ;
2100
- op_free = Z_OBJ_HT_P (op2 )-> get (Z_OBJ_P (op2 ), & rv );
2101
- ret = compare_function (result , op1 , op_free );
2102
- zend_free_obj_get_result (op_free );
2103
- return ret ;
2104
- } else if (Z_TYPE_P (op1 ) != IS_OBJECT && Z_OBJ_HT_P (op2 )-> cast_object ) {
2076
+ if (Z_TYPE_P (op1 ) != IS_OBJECT && Z_OBJ_HT_P (op2 )-> cast_object ) {
2105
2077
ZVAL_UNDEF (& tmp_free );
2106
2078
if (Z_OBJ_HT_P (op2 )-> cast_object (Z_OBJ_P (op2 ), & tmp_free , ((Z_TYPE_P (op1 ) == IS_FALSE || Z_TYPE_P (op1 ) == IS_TRUE ) ? _IS_BOOL : Z_TYPE_P (op1 ))) == FAILURE ) {
2107
2079
ZVAL_LONG (result , -1 );
@@ -2549,17 +2521,6 @@ ZEND_API int ZEND_FASTCALL zend_object_is_true(zval *op) /* {{{ */
2549
2521
return Z_TYPE (tmp ) == IS_TRUE ;
2550
2522
}
2551
2523
zend_error (E_RECOVERABLE_ERROR , "Object of class %s could not be converted to bool" , ZSTR_VAL (zobj -> ce -> name ));
2552
- } else if (zobj -> handlers -> get ) {
2553
- int result ;
2554
- zval rv ;
2555
- zval * tmp = zobj -> handlers -> get (zobj , & rv );
2556
-
2557
- if (Z_TYPE_P (tmp ) != IS_OBJECT ) {
2558
- /* for safety - avoid loop */
2559
- result = i_zend_is_true (tmp );
2560
- zval_ptr_dtor (tmp );
2561
- return result ;
2562
- }
2563
2524
}
2564
2525
return 1 ;
2565
2526
}
0 commit comments