mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Merge branch 'PHP-7.4'
* PHP-7.4: Fix DatePeriod property handling with indirect modification
This commit is contained in:
commit
a66e226713
@ -5059,15 +5059,18 @@ static zval *date_period_write_property(zend_object *object, zend_string *name,
|
||||
return value;
|
||||
}
|
||||
|
||||
std_object_handlers.write_property(object, name, value, cache_slot);
|
||||
return value;
|
||||
return zend_std_write_property(object, name, value, cache_slot);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ date_period_get_property_ptr_ptr */
|
||||
static zval *date_period_get_property_ptr_ptr(zend_object *object, zend_string *member, int type, void **cache_slot)
|
||||
static zval *date_period_get_property_ptr_ptr(zend_object *object, zend_string *name, int type, void **cache_slot)
|
||||
{
|
||||
/* Fall back to read_property handler. */
|
||||
return NULL;
|
||||
if (date_period_is_magic_property(name)) {
|
||||
zend_throw_error(NULL, "Retrieval of DatePeriod->%s for modification is unsupported", ZSTR_VAL(name));
|
||||
return &EG(error_zval);
|
||||
}
|
||||
|
||||
return zend_std_get_property_ptr_ptr(object, name, type, cache_slot);
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -28,6 +28,9 @@ $period->dynamic2 = [];
|
||||
$period->dynamic2[] = "array";
|
||||
var_dump($period->dynamic2);
|
||||
|
||||
$period->dynamic3[] = "array";
|
||||
var_dump($period->dynamic3);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(5) "stuff"
|
||||
@ -42,3 +45,7 @@ array(1) {
|
||||
[0]=>
|
||||
string(5) "array"
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(5) "array"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user