History log of /PHP-8.3/Zend/zend_API.c (Results 1 – 25 of 1135)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# d41e97ae 24-Jul-2024 Dmitry Stogov

Workaraound against false positive GCC array bounds error (#15078)

This prevents compilation error when compiling PHP by GCC with "-O2 -g -Wall -Werror"

zend_API.c:2754:34: error: a

Workaraound against false positive GCC array bounds error (#15078)

This prevents compilation error when compiling PHP by GCC with "-O2 -g -Wall -Werror"

zend_API.c:2754:34: error: array subscript ‘zend_function
{aka const union _zend_function}[0]’ is partly outside array bounds of
‘unsigned char[160]’ [-Werror=array-bounds=]

2754 | if (ZSTR_VAL(fptr->common.function_name)[0] != '_'

show more ...


# 2f605820 13-Feb-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Workaround ZTS persistent resource crashes (PHP 8.3 and lower)

For master (8.4-dev) I merged GH-13381. But that PR changes public API
of TSRM, so cannot be used on lower branches.

Workaround ZTS persistent resource crashes (PHP 8.3 and lower)

For master (8.4-dev) I merged GH-13381. But that PR changes public API
of TSRM, so cannot be used on lower branches.

This patch is a safe workaround for the issue, in combination with a
pre-existing fix using `ifdef ZTS + if (module_started)` inside pgsql
and odbc. The idea is to delay unloading modules until the persistent
resources are destroyed. This will keep the destructor code accessible
in memory.

This is not a proper fix on its own, because we still need the
workaround of not accessing globals after module destruction.
The proper fix is in master.

Closes GH-13388.

show more ...


# a8c6c616 07-Oct-2023 Jakub Zelenka

Fix GH-9921: Loading ext in FPM config does not register module handlers

Closes GH-12377


# af3d2f7e 18-Oct-2023 Ilija Tovilo

Fix double-free of doc_comment when overriding static property via trait

When redeclaring an overridden static property with a trait we're removing the
property from the class. However,

Fix double-free of doc_comment when overriding static property via trait

When redeclaring an overridden static property with a trait we're removing the
property from the class. However, because the property itself does not belong to
the class we must not free its associated data.

This issue is exposed by 9a250cc9d6 in PHP 8.3+ because duplicate static
properties in traits are no longer skipped, but redeclared.

Fixes GH-12468

show more ...


# 910f579f 18-Sep-2023 Florian Sowade

Fix GH-12207 memory leak of doc blocks of static properties

When declaring the same static property with a doc block in a class and in a trait,
the doc block of the property in the class

Fix GH-12207 memory leak of doc blocks of static properties

When declaring the same static property with a doc block in a class and in a trait,
the doc block of the property in the class is leaked. While at it, possibly fix doc
comment for internal classes.

Close GH-12238

show more ...


# 53aa53f4 24-Aug-2023 Jakub Zelenka

Introduce Zend guard recursion protection

This PR introduces a new way of recursion protection in JSON, var_dump
and friends. It fixes issue in master for __debugInfo and also improves

Introduce Zend guard recursion protection

This PR introduces a new way of recursion protection in JSON, var_dump
and friends. It fixes issue in master for __debugInfo and also improves
perf for jsonSerializable in some cases. More info can be found in
GH-10020.

Closes GH-11812

show more ...


# 7f1c3bf0 18-Aug-2023 ju1ius

Adds support for DNF types in internal functions and properties (#11969)

Note that this does not add support for items generated by gen_stubs,
only for items registered dynamically via

Adds support for DNF types in internal functions and properties (#11969)

Note that this does not add support for items generated by gen_stubs,
only for items registered dynamically via the Zend API.

Closes GH-10120

show more ...


# 80e90ad7 07-Mar-2023 George Peter Banyard

Add number or str ZPP macros


# d5ad7510 08-Jun-2023 George Peter Banyard

More usage of known zend_str instead of C string (#11381)


# 99fa740a 06-Jun-2023 George Peter Banyard

Use common function for TypeError on illegal offset access (#10544)

This merges all usages of emitting an offset TypeError into a new ZEND_API function
zend_illegal_container_offset(cons

Use common function for TypeError on illegal offset access (#10544)

This merges all usages of emitting an offset TypeError into a new ZEND_API function
zend_illegal_container_offset(const zend_string* container, const zval *offset, int type);

Where the container should represent the type on which the access is attempted (e.g. string, array)
The offset zval that is used, where the error message will display its type
The type of access, which should be a BP_VAR_* constant, to get special message for isset/empty/unset

show more ...


# 9ce6980b 05-Jun-2023 George Peter Banyard

Use known zend_string pointer to check for equality instead of C strings (#11370)

* Compare __invoke magic method name with known zend_string pointer

* Compare __sleep/__wakeup magi

Use known zend_string pointer to check for equality instead of C strings (#11370)

* Compare __invoke magic method name with known zend_string pointer

* Compare __sleep/__wakeup magic method name with known zend_string pointer

show more ...


# 414f71a9 16-Apr-2023 Máté Kocsis

Typed class constants (#10444)

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

Co-Authored-By: Ben <7127204+moliata@users.noreply.github.com>
Co-Authored-By: Bob Weinand <31

Typed class constants (#10444)

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

Co-Authored-By: Ben <7127204+moliata@users.noreply.github.com>
Co-Authored-By: Bob Weinand <3154871+bwoebi@users.noreply.github.com>
Co-Authored-By: Ilija Tovilo <ilija.tovilo@me.com>

show more ...


# c9d728cb 04-Apr-2023 Dmitry Stogov

Revert "Zend/zend_types.h: move `zend_rc_debug` to `zend_rc_debug.h`"

This reverts commit d6e95041e291f1f41e1da43e616c6354705464d3.


# 574e5311 09-Mar-2023 Máté Kocsis

Micro optimization: readonly properties always have a type


# 6a711535 05-Mar-2023 Ilija Tovilo

Fix gcc warnings in zend_API.c with --disable-debug (#10786)

-Warray-bounds complains about malloc(sizeof(zend_arg_info) * num_args) being
smaller than zend_function when dereferencing r

Fix gcc warnings in zend_API.c with --disable-debug (#10786)

-Warray-bounds complains about malloc(sizeof(zend_arg_info) * num_args) being
smaller than zend_function when dereferencing reg_function.

show more ...


# 3bcf2c37 28-Feb-2023 Máté Kocsis

Allow readonly properties to be reinitialized once during cloning (#10389)

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


# d6e95041 13-Jan-2023 Max Kellermann

Zend/zend_types.h: move `zend_rc_debug` to `zend_rc_debug.h`

`zend_rc_debug` is not a type and does not really belong in
`zend_types.h`; this allows using `ZEND_RC_MOD_CHECK()` without

Zend/zend_types.h: move `zend_rc_debug` to `zend_rc_debug.h`

`zend_rc_debug` is not a type and does not really belong in
`zend_types.h`; this allows using `ZEND_RC_MOD_CHECK()` without
including the huge `zend_types.h` header and allows decoupling
circular header dependencies.

show more ...


# 9108a32b 26-Feb-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Minor cleanups in Zend execution APIs (#10699)

* Remove always-false check in zend_lookup_class_ex()

This check is always false because of the undefined behaviour rule that
says

Minor cleanups in Zend execution APIs (#10699)

* Remove always-false check in zend_lookup_class_ex()

This check is always false because of the undefined behaviour rule that
says a NULL pointer must never be dereferenced: we already dereference name
when checking the cache slot, before the NULL check. So the NULL may be
optimised away by the compiler. It looks like the code isn't even
supposed to work with name being NULL, so just remove the check.

* Remove always-true check in zend_fetch_static_property_address_ex()

* Simplify always-true conditions

show more ...


# 8959ff39 24-Feb-2023 nielsdos <7771979+nielsdos@users.noreply.github.com>

Fix incorrect type for return value of zend_update_static_property_ex()

zend_update_static_property_ex() returns a zend_result, but the return
value is stored here in a bool. A bool is u

Fix incorrect type for return value of zend_update_static_property_ex()

zend_update_static_property_ex() returns a zend_result, but the return
value is stored here in a bool. A bool is unsigned on my system, so in
case zend_update_static_property_ex() returns FAILURE (== -1) this gets
converted to 1 instead. This is not a valid zend_result value. This
means that (transitive) callers could mistakingly think the function
succeeded while it did in fact not succeed. Fix it by changing the type
to zend_result.

Closes GH-10691.

show more ...


# d5c649b3 23-Feb-2023 Max Kellermann

zend_compiler, ...: use `uint8_t` instead of `zend_uchar` (#10621)

`zend_uchar` suggests that the value is an ASCII character, but here,
it's about very small integers. This is misleadi

zend_compiler, ...: use `uint8_t` instead of `zend_uchar` (#10621)

`zend_uchar` suggests that the value is an ASCII character, but here,
it's about very small integers. This is misleading, so let's use a
C99 integer instead.

On all architectures currently supported by PHP, `zend_uchar` and
`uint8_t` are identical. This change is only about code readability.

show more ...


# 821fc55a 22-Feb-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement GH-9826: Make class_alias() work with internal classes (#10483)

We can't increase the refcount of internal classes during request time.
To work around this problem we simply do

Implement GH-9826: Make class_alias() work with internal classes (#10483)

We can't increase the refcount of internal classes during request time.
To work around this problem we simply don't refcount aliases anymore and
add a check in the destruction to skip aliases entirely.
There were also some checks which checked for an alias implicitly by
comparing the refcount, these have been replaced by checking the type of
the zval instead.

show more ...


# 413844d6 18-Feb-2023 Max Kellermann

Zend/zend_types.h: deprecate zend_bool, zend_intptr_t, zend_uintptr_t (#10597)

These types are standard C99.

For compatibility with out-of-tree extensions, keep the typedefs
in

Zend/zend_types.h: deprecate zend_bool, zend_intptr_t, zend_uintptr_t (#10597)

These types are standard C99.

For compatibility with out-of-tree extensions, keep the typedefs
in main/php.h.

show more ...


# 641fe23e 08-Feb-2023 Marcos Marcolin <48370677+marcosmarcolin@users.noreply.github.com>

Improve illegal offset error messages (#10504)

Co-authored-by: Marcos Marcolin <marcos@ixcsoft.com.br>


# 7936c808 23-Jan-2023 Máté Kocsis

Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385)


# 8d21a6b2 17-Jan-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix UNEXPECTED() paren mistakes.

This corrects the paren placement to the intended one.
As these functions use zend_result, the success value is zero. Therefore
this has no functiona

Fix UNEXPECTED() paren mistakes.

This corrects the paren placement to the intended one.
As these functions use zend_result, the success value is zero. Therefore
this has no functional change. The only difference is that this now
hints the compiler optimizer correctly.

Closes GH-10364.

show more ...


12345678910>>...46