diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-01-07 12:28:51 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-01-11 15:49:06 +0100 |
commit | e219ec144ef6682b71e135fd18654ee1bb4676b4 (patch) | |
tree | e4a3ae2b619cdc9fe50ee8e1fa5adb99d804dddf /Zend/zend_object_handlers.h | |
parent | fe8fdfa3bd588d80ce60f6b3848058239e0a760f (diff) | |
download | php-git-e219ec144ef6682b71e135fd18654ee1bb4676b4.tar.gz |
Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2
This is a squash of PR #3734, which is a squash of PR #3313.
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
Diffstat (limited to 'Zend/zend_object_handlers.h')
-rw-r--r-- | Zend/zend_object_handlers.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index fbb66f798a..c3b5fda42d 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -51,9 +51,10 @@ typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int ty If you receive a value zval in write_property/write_dimension, you may only modify it if its reference count is 1. Otherwise, you must create a copy of that zval before making any changes. You should NOT modify the reference count of the value passed to you. + You must return the final value of the assigned property. */ /* Used to set property of the object */ -typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value, void **cache_slot); +typedef zval *(*zend_object_write_property_t)(zval *object, zval *member, zval *value, void **cache_slot); /* Used to set dimension of the object */ typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *value); @@ -199,7 +200,8 @@ extern const ZEND_API zend_object_handlers std_object_handlers; ZEND_API void zend_class_init_statics(zend_class_entry *ce); ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key); -ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent); +ZEND_API zval *zend_std_get_static_property_with_info(zend_class_entry *ce, zend_string *property_name, int type, struct _zend_property_info **prop_info); +ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, int type); ZEND_API ZEND_COLD zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name); ZEND_API zend_function *zend_std_get_constructor(zend_object *object); ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int silent); @@ -209,7 +211,7 @@ ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp); ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type); ZEND_API zval *zend_std_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot); ZEND_API zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv); -ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, void **cache_slot); +ZEND_API zval *zend_std_write_property(zval *object, zval *member, zval *value, void **cache_slot); ZEND_API int zend_std_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot); ZEND_API void zend_std_unset_property(zval *object, zval *member, void **cache_slot); ZEND_API zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv); |