Skip to content

Commit 26c2f34

Browse files
iluuu1994nikic
authored andcommitted
Update some object handlers to return zend_result
See php/php-src#8755
1 parent 25acbe7 commit 26c2f34

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Book/php7/classes_objects/object_handlers.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Here are all the object handlers with their signature and a small description.
5555
disallow manual construction by throwing an error in the handler.
5656

5757
.. c:member::
58-
int count_elements(zend_object *object, zend_long *count)
58+
zend_result count_elements(zend_object *object, zend_long *count)
5959
6060
This is just the internal way of implementing the ``Countable::count`` method. The function returns a
6161
``zend_result`` and assigns the value to the ``zend_long *count`` pointer.
@@ -71,14 +71,14 @@ Here are all the object handlers with their signature and a small description.
7171
the values are uncomparable ``ZEND_UNCOMPARABLE`` should be returned.
7272

7373
.. c:member::
74-
int cast_object(zend_object *readobj, zval *writeobj, int type)
74+
zend_result cast_object(zend_object *readobj, zval *writeobj, int type)
7575
7676
Internal classes have the ability to implement a custom compare behavior and override casting behavior for all
7777
types. Userland classes on the other hand only have the ability to override object to string casting through
7878
``__toString``.
7979

8080
.. c:member::
81-
int get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only)
81+
zend_result get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only)
8282
8383
This handler is invoked when the object is used as a function, i.e. it is the internal version of ``__invoke``.
8484
The name derives from the fact that its main use is for the implementation of closures (the ``Closure`` class).
@@ -122,7 +122,7 @@ Here are all the object handlers with their signature and a small description.
122122
longer active, in which case execution of user code may be skipped.
123123

124124
.. c:member::
125-
int do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2)
125+
zend_result do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2)
126126
127127
``do_operation`` is an optional handler that will be invoked for various arithmetic and binary operations on
128128
instances of the given class. This allows for operator overloading semantics to be implemented for custom classes.

0 commit comments

Comments
 (0)