History log of /PHP-8.2/ext/spl/spl_observer.c (Results 1 – 25 of 238)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 0d4e0c01 06-Jul-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-14639: Member access within null pointer in ext/spl/spl_observer.c

`spl_object_storage_attach_handle` creates an entry already, but only
fills it in at the end with `spl_object_st

Fix GH-14639: Member access within null pointer in ext/spl/spl_observer.c

`spl_object_storage_attach_handle` creates an entry already, but only
fills it in at the end with `spl_object_storage_create_element` which
allocates memory. In this case the allocation fails and we're left with
a NULL slot. Doing the allocation first isn't an option because we want
to check whether the slot is occupied before allocating memory.
The simplest solution is to set the entry to NULL and check for a NULL
pointer upon destruction.

Closes GH-14849.

show more ...


# a01dd9fe 14-Sep-2022 Bob Weinand

Revert "Port all internally used classes to use default_object_handlers"

This reverts commit 94ee4f9834743ca74f6c9653863273277ce6c61a.

The commit was a bit too late to be included i

Revert "Port all internally used classes to use default_object_handlers"

This reverts commit 94ee4f9834743ca74f6c9653863273277ce6c61a.

The commit was a bit too late to be included in PHP 8.2 RC1. Given it's a massive ABI break, we decide to postpone the change to PHP 8.3.

show more ...

# 94ee4f98 24-Aug-2022 Bob Weinand

Port all internally used classes to use default_object_handlers

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>

# bc4c0126 24-Aug-2022 Máté Kocsis

Declare ext/standard constants in stubs - part 1 (#9404)

# b73f139c 02-Aug-2022 Máté Kocsis

Declare ext/spl constants in stubs (#9226)

# 4df3dd76 08-Jul-2022 Arnaud Le Blanc

Reduce memory allocated by var_export, json_encode, serialize, and other (#8902)

smart_str uses an over-allocated string to optimize for append operations. Functions that use smart_str tend

Reduce memory allocated by var_export, json_encode, serialize, and other (#8902)

smart_str uses an over-allocated string to optimize for append operations. Functions that use smart_str tend to return the over-allocated string directly. This results in unnecessary memory usage, especially for small strings.

The overhead can be up to 231 bytes for strings smaller than that, and 4095 for other strings. This can be avoided for strings smaller than `4096 - zend_string header size - 1` by reallocating the string.

This change introduces `smart_str_trim_to_size()`, and calls it in `smart_str_extract()`. Functions that use `smart_str` are updated to use `smart_str_extract()`.

Fixes GH-8896

show more ...

# cfc38a60 13-Apr-2022 George Peter Banyard

SPL: minor refactoring (#8341)

Use more appropriate types and return macros

# 024d5f4b 01-Dec-2021 Tyson Andre

Cache method overrides of ArrayAccess in zend_class_entry

Previously, code such as subclasses of SplFixedArray would check for method
overrides when instantiating the objects.

T

Cache method overrides of ArrayAccess in zend_class_entry

Previously, code such as subclasses of SplFixedArray would check for method
overrides when instantiating the objects.

This optimization was mentioned as a followup to GH-6552

show more ...

# 032de9e0 26-Nov-2021 Tyson Andre

Optimize SplObjectStorage native read/write/has/unset dimension handlers

This makes reading/writing with `$splObjectStorage[$offset]` shorthand twice as
fast as it was previously, and a

Optimize SplObjectStorage native read/write/has/unset dimension handlers

This makes reading/writing with `$splObjectStorage[$offset]` shorthand twice as
fast as it was previously, and a bit faster than offsetGet/offsetSet instead of
(previously) much slower.

Call destructor after overriding old SplObjectStorage entry.
Previously, it was called before, which was possibly unsafe
if the destructor had side effects.

Add tests.

Closes GH-7695

Related to GH-7690

Check for ref in SplObjectStorage->__unserialize, check for ref.

SplObjectStorage->unserialize may be a different cause of references
for malformed inputs, so continue checking

In internally used methods, convert references to non-references if they're
found.

show more ...

# d0dbf729 24-Sep-2021 Nikita Popov

Initialize iterator_funcs_ptr upfront

Same as we do for the IteratorAggregate case, initialize the
Iterator methods upfront. This is preparation for an upcoming
change to automatical

Initialize iterator_funcs_ptr upfront

Same as we do for the IteratorAggregate case, initialize the
Iterator methods upfront. This is preparation for an upcoming
change to automatically determine whether get_iterator can be
reused in a child class, in the same way we already do for
IteratorAggregate.

show more ...

# 6d505d44 22-Jul-2021 Nikita Popov

Add RETURN/RETVAL_COPY_DEREF() macros

These were missing from the set...

I think quite a few of these usages don't actually need the DEREF,
but I've just kept things as is for n

Add RETURN/RETVAL_COPY_DEREF() macros

These were missing from the set...

I think quite a few of these usages don't actually need the DEREF,
but I've just kept things as is for now.

show more ...

# 42cb5b5f 14-Jul-2021 Nikita Popov

Throw from MultipleIterator::key/current() for invalid iterator

Calling current()/key() on an invalid iterator is an error
condition. Throw instead of returning false.

# 58f3f751 14-Jul-2021 Nikita Popov

Throw from SplObjectStorage::current() for invalid iterator

Accessing key()/current() on an invalid iterator is an error
condition. Throw instead of returning null.

# 9d2a466c 09-Jun-2021 Nikita Popov

Remove explicit assignments of zend_objects_destroy_object

This is the default handler, no need to set it explicitly. This
makes it easier to see which objects really have a custom dtor_

Remove explicit assignments of zend_objects_destroy_object

This is the default handler, no need to set it explicitly. This
makes it easier to see which objects really have a custom dtor_obj.

show more ...

# 11648c00 18-May-2021 Nikita Popov

Don't include object hash in SplObjectStorage debug dump

The object hash is not particularly useful (anymore) and just
clutters the output. It encodes the same information as the
obj

Don't include object hash in SplObjectStorage debug dump

The object hash is not particularly useful (anymore) and just
clutters the output. It encodes the same information as the
object ID, which is already part of the output.

show more ...

# 01b3fc03 06-May-2021 KsaR

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |

show more ...

# 4f4c031f 18-Feb-2021 Máté Kocsis

Generate ext/spl class entries from stubs

Closes GH-6709

# 3e01f5af 15-Jan-2021 Nikita Popov

Replace zend_bool uses with bool

We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool

Replace zend_bool uses with bool

We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.

show more ...

# d8b22c56 12-Jan-2021 Nikita Popov

Fix INDIRECT elements leaked by SPL __serialize implementations

# d29d3a4b 05-Jan-2021 Nikita Popov

Fix use-after-scope in SplObjectStorage::unserialize()

Introduced by the recent switch to a zend_object. Unserialize the
object into a tmp_var to avoid leaving behind a stack reference.

Fix use-after-scope in SplObjectStorage::unserialize()

Introduced by the recent switch to a zend_object. Unserialize the
object into a tmp_var to avoid leaving behind a stack reference.

Fixes oss-fuzz #29271.

show more ...

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, php-7.1.33, php-7.2.24, php-7.3.11, php-7.4.0RC4, php-7.3.11RC1, php-7.2.24RC1, php-7.4.0RC3, php-7.2.23, php-7.3.10, php-7.4.0RC2, php-7.2.23RC1, php-7.3.10RC1, 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, 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, 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, php-7.3.3RC1, php-7.2.16RC1, php-7.2.15, php-7.3.2, php-7.2.15RC1, php-7.3.2RC1, php-5.6.40, php-7.1.26, php-7.3.1, php-7.2.14, php-7.2.14RC1, php-7.3.1RC1, php-5.6.39, php-7.1.25, php-7.2.13, php-7.0.33, php-7.3.0, php-7.1.25RC1, php-7.2.13RC1, php-7.3.0RC6, php-7.1.24, php-7.2.12, php-7.3.0RC5, php-7.1.24RC1, php-7.2.12RC1, php-7.3.0RC4, php-7.1.23, php-7.2.11, php-7.3.0RC3, php-7.1.23RC1, php-7.2.11RC1, php-7.3.0RC2, php-5.6.38, php-7.1.22, php-7.3.0RC1, php-7.2.10, php-7.0.32, php-7.1.22RC1, php-7.3.0beta3, php-7.2.10RC1, php-7.1.21, php-7.2.9, php-7.3.0beta2, php-7.1.21RC1, php-7.3.0beta1, php-7.2.9RC1, php-5.6.37, php-7.1.20
# e622e868 19-Jul-2018 Tyson Andre

Reduce memory usage of SplObjectStorage

Track an 8-byte pointer as the key instead of 16-byte zval.
(4 byte on 32-bit builds)

The memory used for a set of 1 million objects decr

Reduce memory usage of SplObjectStorage

Track an 8-byte pointer as the key instead of 16-byte zval.
(4 byte on 32-bit builds)

The memory used for a set of 1 million objects decreased from
114 MiB to 106 MiB.

Use the new `Z_PARAM_*` APIs to parse the `zend_object*` pointer directly

Closes GH-6566

show more ...

# 6c3b69bd 29-Dec-2020 George Peter Banyard

Remove superfluous return statement.

# f29dcc16 29-Dec-2020 Tyson Andre

Remove redundant check in SplObjectStorage->count

# 8107a1da 04-Sep-2020 Máté Kocsis

Use ZPP instead of custom type checks

We can add these types as a native type declaration to stubs as a side-effect. Closes GH-6068

# f3d6203b 13-Aug-2020 Nikita Popov

Use a dedicated method for MultipleIterator::countIterators()

This method has a different signature from
SplObjectStorage::count(), so don't share implementations.

12345678910