@@ -143,13 +143,6 @@ ZEND_API zend_long ZEND_FASTCALL zend_atol(const char *str, size_t str_len) /* {
143143 "Object of class %s could not be converted to %s", ZSTR_VAL(Z_OBJCE_P(op)->name),\
144144 zend_get_type_by_const(ctype)); \
145145 } \
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- } \
153146 }
154147
155148/* }}} */
@@ -866,14 +859,6 @@ ZEND_API zend_string* ZEND_FASTCALL zval_get_string_func(zval *op) /* {{{ */
866859 if (Z_OBJ_HT_P (op )-> cast_object (Z_OBJ_P (op ), & tmp , IS_STRING ) == SUCCESS ) {
867860 return Z_STR (tmp );
868861 }
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 );
877862 }
878863 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 ));
879864 return ZSTR_EMPTY_ALLOC ();
@@ -1969,8 +1954,7 @@ ZEND_API int ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2)
19691954{
19701955 int ret ;
19711956 int converted = 0 ;
1972- zval op1_copy , op2_copy ;
1973- zval * op_free , tmp_free ;
1957+ zval op1_copy , op2_copy , tmp_free ;
19741958
19751959 while (1 ) {
19761960 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)
20762060 }
20772061 }
20782062 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 ) {
20862064 ZVAL_UNDEF (& tmp_free );
20872065 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 ) {
20882066 ZVAL_LONG (result , 1 );
@@ -2095,13 +2073,7 @@ ZEND_API int ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2)
20952073 }
20962074 }
20972075 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 ) {
21052077 ZVAL_UNDEF (& tmp_free );
21062078 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 ) {
21072079 ZVAL_LONG (result , -1 );
@@ -2549,17 +2521,6 @@ ZEND_API int ZEND_FASTCALL zend_object_is_true(zval *op) /* {{{ */
25492521 return Z_TYPE (tmp ) == IS_TRUE ;
25502522 }
25512523 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- }
25632524 }
25642525 return 1 ;
25652526}
0 commit comments