History log of /PHP-8.2/Zend/zend_object_handlers.c (Results 76 – 100 of 625)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 8fd7f02e 31-Mar-2020 Nikita Popov

Make cast_object handler required

Avoid subtle differences in behavior depending on whether the
handler is absent or returns FAILURE.

If you previously set cast_object to NULL,

Make cast_object handler required

Avoid subtle differences in behavior depending on whether the
handler is absent or returns FAILURE.

If you previously set cast_object to NULL, create a handler that
always returns FAILURE instead.

show more ...


# fb5bfcb7 31-Mar-2020 Nikita Popov

Add a ZEND_UNCOMPARABLE value

To explicitly indicate that objects are uncomparable. For now
this has no functional difference from the usual 1 return value,
but makes intent clearer.


# bef4b2e4 31-Mar-2020 Nikita Popov

Report object cast failures internally

Make cast_object return FAILURE for casts to int/float, rather than
throwing a notice and returning SUCCESS. Instead move the emission
of the n

Report object cast failures internally

Make cast_object return FAILURE for casts to int/float, rather than
throwing a notice and returning SUCCESS. Instead move the emission
of the notice to the code invoking cast_object. This will allow us
to customize the behavior per call-site.

This change is written to be NFC, and the code in
zend_std_compare_objects() should illustrate the current behavior
doesn't make a lot of sense.

show more ...


# b0c920f9 21-Jan-2020 Nikita Popov

Simplify __call fetching for static methods

If we have a __call on a parent, we should always also have a
__call on the child, so there's no need to perform this walk.


Revision tags: php-7.3.13RC1, php-7.2.26RC1, php-7.4.0, php-7.2.25, php-7.3.12, php-7.4.0RC6, php-7.3.12RC1, php-7.2.25RC1, php-7.4.0RC5
# 84354c62 28-Oct-2019 Nikita Popov

Fixed bug #78904: Don't call any magic for uninitialized typed properties

We already changed the behavior for __set() in f1848a4. However, it
seems that this is also a problem for all th

Fixed bug #78904: Don't call any magic for uninitialized typed properties

We already changed the behavior for __set() in f1848a4. However, it
seems that this is also a problem for all the other property magic,
see bug #78904.

This commit makes the behavior of all the property magic consistent:
Magic will not be triggered for uninitialized typed properties, only
explicitly unset() ones. This brings behavior more in line how
non-typed properties behave and avoids WTF.

Closes GH-4974.

show more ...


# 266f3a02 15-Nov-2019 Nikita Popov

Fixed bug #78810


# c46b2ed6 04-Nov-2019 Nikita Popov

Remove support for array_key_exists() with objects


# f1848a4b 24-Oct-2019 Nikita Popov

Fix bug #78226: Don't call __set() on uninitialized typed properties

Assigning to an uninitialized typed property will no longer trigger
a call to __set(). However, calls to __set() are

Fix bug #78226: Don't call __set() on uninitialized typed properties

Assigning to an uninitialized typed property will no longer trigger
a call to __set(). However, calls to __set() are still triggered if
the property is explicitly unset().

This gives us both the behavior people generally expect, and still
allows ORMs to do lazy initialization by unsetting properties.

For PHP 8, we should fine a way to forbid unsetting of declared
properties entirely, and provide a different way to achieve lazy
initialization.

show more ...


# c858d17f 25-Oct-2019 Nikita Popov

Optimize instanceof_function

Split out the simple equality check into an inline function --
this is one of the common cases.

Replace instanceof_function_ex with zend_class_imple

Optimize instanceof_function

Split out the simple equality check into an inline function --
this is one of the common cases.

Replace instanceof_function_ex with zend_class_implements_interface.
There are a few more places where it may be used.

show more ...


Revision tags: php-7.1.33, php-7.2.24, php-7.3.11, php-7.4.0RC4
# 5a076e67 10-Oct-2019 Nikita Popov

Return error_zval form get_property_ptr_ptr on exception

This goes in the reverse direction of 4463acb9513dfb62206760c49b3da1fe4d92f40a.
After looking around a bit, it seems that we alre

Return error_zval form get_property_ptr_ptr on exception

This goes in the reverse direction of 4463acb9513dfb62206760c49b3da1fe4d92f40a.
After looking around a bit, it seems that we already check for
Z_ISERROR_P() on the get_property_ptr_ptr return value in other places.
So do this in zend_fetch_property_address() as well, and also make
sure that EG(error_zval) is indeed returned on exception in
get_property_ptr_ptr.

In particular, this fixes the duplicate exceptions that we used to
get because first get_property_ptr_ptr threw one and then
read_property throws the same exception again.

show more ...


Revision tags: php-7.3.11RC1, php-7.2.24RC1
# b02b8129 07-Oct-2019 Dmitry Stogov

Comparison cleanup:

- introduce zend_compare() that returns -1,0,1 dirctly (without intermediate zval)
- remove compare_objects() object handler, and keep only compare() handler


# 2f92957f 01-Oct-2019 Nikita Popov

Convert some notices to warnings

Part of https://wiki.php.net/rfc/engine_warnings.


Revision tags: php-7.4.0RC3, php-7.2.23, php-7.3.10
# 0c7124e6 23-Sep-2019 Christoph M. Becker

Add check_only parameter to get_closure handler

`get_closure` handlers are called to check whether an object is
callable, and to actually get the closure, respectively. The behavior

Add check_only parameter to get_closure handler

`get_closure` handlers are called to check whether an object is
callable, and to actually get the closure, respectively. The behavior
of the handler might differ for these two cases, particularly the
handler may throw in the latter case, but should not in the former.

Therefore we add a `check_only` parameter, to be able to distinguish
the desired purpose.

show more ...


# 6276dd82 23-Sep-2019 Nikita Popov

Use ZEND_TYPE_IS_SET() when checking for property types

Instead of a simple if or 0 comparison. This would no longer work
if zend_type is a struct.


Revision tags: php-7.4.0RC2, php-7.2.23RC1, php-7.3.10RC1
# ee4b11c6 05-Sep-2019 Nikita Popov

Detect calls to abstract methods in get_method() already

Instead of checking for this during DO_FCALL, already detect this
case during get_method()/get_static_method(), similar to visibi

Detect calls to abstract methods in get_method() already

Instead of checking for this during DO_FCALL, already detect this
case during get_method()/get_static_method(), similar to visibility
checks.

This causes a minor difference in behavior, in that arguments will
no longer be evaluated. I think this is correct though (and consistent
with visibility errors).

show more ...


Revision tags: php-7.4.0RC1, php-7.1.32, php-7.2.22, php-7.3.9, php-7.4.0beta4, php-7.2.22RC1, php-7.3.9RC1
# 358379be 08-Aug-2019 Dmitry Stogov

Fixed bug #78379 (Cast to object confuses GC, causes crash)


Revision tags: php-7.4.0beta2, php-7.1.31, php-7.2.21, php-7.3.8, php-7.4.0beta1, php-7.2.21RC1, php-7.3.8RC1, php-7.4.0alpha3, php-7.3.7, php-7.2.20, php-7.4.0alpha2
# 0f29fb5c 24-Jun-2019 Dmitry Stogov

Fixed bug 78175 (Preloading must store default values of static variables and properties)


Revision tags: php-7.3.7RC3, php-7.3.7RC2, php-7.2.20RC2, php-7.4.0alpha1, php-7.3.7RC1, php-7.2.20RC1, php-7.2.19, php-7.3.6, php-7.1.30, php-7.2.19RC1, php-7.3.6RC1, php-7.1.29, php-7.2.18, php-7.3.5, php-7.2.18RC1, php-7.3.5RC1, php-7.2.17, php-7.3.4, php-7.1.28, php-7.3.4RC1, php-7.2.17RC1, php-7.1.27, php-7.3.3, php-7.2.16
# a31f4642 26-Feb-2019 Nikita Popov

Allow exceptions in __toString()

RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error excep

Allow exceptions in __toString()

RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.

show more ...


# 45a0656e 29-May-2019 Nikita Popov

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

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.

show more ...


# e14d7733 29-May-2019 Dmitry Stogov

Mark "cold" functions


# 31a516cf 28-May-2019 Nikita Popov

Remove set() object handler


# 83804519 28-May-2019 Dmitry Stogov

Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros


# a7c99f3d 19-Feb-2019 Dmitry Stogov

Reorder conditions


Revision tags: php-7.3.3RC1, php-7.2.16RC1
# da3316ff 18-Feb-2019 Tyson Andre

Fix typos in code comments in Zend/ [skip ci]


# f45e0ce9 07-Feb-2019 Dmitry Stogov

Remove ZEND_OVERLOADED_FUNCTION and corresponding call_method object handler


12345678910>>...25