Remove get() object handler

Now that set() is gone, there is little point in keeping get(), as
it is essentially just a different way of writing cast_object()
now.

Closes GH-4202.
This commit is contained in:
Nikita Popov 2019-05-29 11:52:55 +02:00
parent 693955c5c5
commit 45a0656e95
14 changed files with 22 additions and 190 deletions

View file

@ -789,7 +789,6 @@ ZEND_FUNCTION(define)
ZVAL_UNDEF(&val_free);
repeat:
switch (Z_TYPE_P(val)) {
case IS_LONG:
case IS_DOUBLE:
@ -810,17 +809,10 @@ repeat:
}
break;
case IS_OBJECT:
if (Z_TYPE(val_free) == IS_UNDEF) {
if (Z_OBJ_HT_P(val)->get) {
zval rv;
val = Z_OBJ_HT_P(val)->get(Z_OBJ_P(val), &rv);
ZVAL_COPY_VALUE(&val_free, val);
goto repeat;
} else if (Z_OBJ_HT_P(val)->cast_object) {
if (Z_OBJ_HT_P(val)->cast_object(Z_OBJ_P(val), &val_free, IS_STRING) == SUCCESS) {
val = &val_free;
break;
}
if (Z_OBJ_HT_P(val)->cast_object) {
if (Z_OBJ_HT_P(val)->cast_object(Z_OBJ_P(val), &val_free, IS_STRING) == SUCCESS) {
val = &val_free;
break;
}
}
/* no break */