Skip to content

Commit efc73f2

Browse files
committed
Revert "Call cast_object handler from get_properties_for"
This reverts commit 4182813.
1 parent 7397607 commit efc73f2

File tree

4 files changed

+0
-17
lines changed

4 files changed

+0
-17
lines changed

UPGRADING.INTERNALS

-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ PHP 8.3 INTERNALS UPGRADE NOTES
7070
* _php_stream_dirent now has an extra d_type field that is used to store the
7171
directory entry type. This can be used to avoid additional stat calls for
7272
types when the type is already known.
73-
* zend_std_get_properties_for now calls the cast_object handler when casting
74-
objects to arrays.
7573

7674
========================
7775
2. Build system changes

Zend/zend_object_handlers.c

-10
Original file line numberDiff line numberDiff line change
@@ -1975,16 +1975,6 @@ ZEND_API HashTable *zend_std_get_properties_for(zend_object *obj, zend_prop_purp
19751975
}
19761976
ZEND_FALLTHROUGH;
19771977
case ZEND_PROP_PURPOSE_ARRAY_CAST:
1978-
if (obj->handlers->cast_object != std_object_handlers.cast_object) {
1979-
zval result;
1980-
if (obj->handlers->cast_object(obj, &result, IS_ARRAY) == SUCCESS) {
1981-
return Z_ARRVAL(result);
1982-
}
1983-
if (EG(exception)) {
1984-
return NULL;
1985-
}
1986-
}
1987-
ZEND_FALLTHROUGH;
19881978
case ZEND_PROP_PURPOSE_SERIALIZE:
19891979
case ZEND_PROP_PURPOSE_VAR_EXPORT:
19901980
case ZEND_PROP_PURPOSE_JSON:

ext/com_dotnet/com_handlers.c

-4
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,6 @@ static int com_objects_compare(zval *object1, zval *object2)
431431

432432
static zend_result com_object_cast(zend_object *readobj, zval *writeobj, int type)
433433
{
434-
if (type == IS_ARRAY) {
435-
return FAILURE;
436-
}
437-
438434
php_com_dotnet_object *obj;
439435
VARIANT v;
440436
VARTYPE vt = VT_EMPTY;

ext/simplexml/simplexml.c

-1
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,6 @@ static zend_result cast_object(zval *object, int type, char *contents)
18191819
convert_scalar_to_number(object);
18201820
break;
18211821
default:
1822-
zval_ptr_dtor_nogc(object);
18231822
return FAILURE;
18241823
}
18251824
return SUCCESS;

0 commit comments

Comments
 (0)