clang 18 is going to be released and in the meantime the counted_by
attribute usage had been constrained to true flexible arrays,
typical cases such as type name[1] ZEND_ELEMENT_COUNT(size) no longer
build.
Since PHP 8.3, object handlers may be changed by setting
ce->default_object_handlers, rather than in ce->create_object. Some checks need
to be extended to check for the default handlers.
Closes GH-13272
* Fix GH-13193: Significant performance degradation in 'foreach' starting from PHP 8.2.13 (caused by garbage collection)
* Don't run zend_gc_remove_root_tmpvars() if GC is not active or GC buffer is empty
Add various tests showcasing the behavioural variations of different offset types used on various container types in all possible operations:
- Read
- Write
- Read Write
- Appending
- Unsetting
- Existence checks with isset()/empty/null coalesce operator
- Behaviour of nesting dimensions (e.g. $container[$offset1][$offset2])
Add a test to ensure compile time and runtime behaviour is identical for offsets.
Add an internal class that overloads the dimension object handlers to zend_test
Previously, this variable was necessary because of auto-vivification on
UNDEF/null/false. It's now only used for RC inference, as auto-vivification has
been removed.
This implicitly solves an inference problem for $obj->bar &= $obj; where we get
a new variable for both literal references to $obj, with the first one getting
the RCn flag, and the second one getting the MAY_BE_REFERENCE flag. Thus, the
first variable will be missing the reference type, causing a false-positive type
inference warning.
If we want to verify RC inference at some point we'll need a better solution.
Closes GH-13233
Previously, when an array was converted from packed to hashed, iterators would
not be correctly reset to 0. Similarly, removing the last element from an array
would decrease nNumUsed but not actually fix the iterator position, causing the
element to be skipped in the next iteration.
Some code was also removed that skips over IS_UNDEF elements for
nInternalPointer and iterator positions. This is unnecessary, as this already
happens during iteration.
Closes GH-13178
Closes GH-13188
When investigating another bug reported by GitHub user 'tstangner',
I discovered that PHP segfaults when the INI parameter
zend.script_encoding is set to "pass". This bug dates back to
December 2022 (caused by yours truly in 953864661a).
If any PHP users in the wild were actually setting zend.script_encoding
to "pass" (which would be an utterly useless thing to do), I expect that
someone would have filed a bug report by now. The absence of such bug
reports is evidence that nobody is doing this.
Hence, it seems that the best fix is simply to disallow "pass" as a
choice for zend.script_encoding. The internal function
'php_mb_zend_encoding_list_parser' which I am modifying to accomplish
this has no other in-tree callers, aside from the 'exif' extension.
Further, exif only calls the function with a few hard-coded values, and
none of them are the string "pass", so this change will not have any
impact on exif.
* PHP-8.3:
Fix GH-13177: PHP 8.3.2: final private constructor not allowed when used in trait
Fix GH-12107: When running a stored procedure (that returns a result set) twice, PHP crashes
zend_compile has an exception to this rule for constructors using
`zend_is_constructor`, which compares the function name to
`__construct`. Sadly, `zend_is_constructor` is not a public API, but we
can just do the string compare ourselves.
Closes GH-13179.
* Arrays returned from range are never empty
* When step is a double value representable by a long, it is coerced implicitly.
As such, passing a double step no longer guarantees that the result is a
non-int array.
Closes GH-13166
Recentlty this insructions were updated to emit warning on inability to
convert double index to long. This may lead to exception.
This fixes memory leak on wordpress test suite (nightly workflow)