Skip to content

[pull] master from php:master - #1304

Merged
pull[bot] merged 10 commits into
turkdevops:masterfrom
php:master
Sep 25, 2026
Merged

pull[bot] merged 10 commits into
turkdevops:masterfrom
php:master

Conversation

@pull

@pull pull Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

lazerg and others added 10 commits September 25, 2026 06:17
dom_html_collection_named_item() seeded the iterator with basep->children,
but the handlers disagreed on what that seed meant: the noop handler never
moved it, the class name handler skipped the first child, and the children
handler never advanced past a non-matching first element. The iterator now
starts with a NULL candidate, and the children and tag name handlers start
from basep->children when they see NULL.

Close GH-23888
* PHP-8.5:
  Fix GH-23887: HTMLCollection::namedItem() mishandles the first child
* PHP-8.6:
  Fix GH-23887: HTMLCollection::namedItem() mishandles the first child
The call stack was sized as op_array->last / 2, on the assumption that every
call needs at least an INIT and a DO_FCALL opcode. That assumption does not
hold after the optimizer has removed the DO_FCALL opcodes as dead code, in
which case nothing pops the stack again:

```php
    function test() {
        new A(new B(new C(new D(match ([]) { 1 => 2 }))));
    }
```

The match arm never matches, so everything behind the ZEND_MATCH_ERROR is
removed and the optimized op_array is just four ZEND_NEWs followed by the
ZEND_MATCH_ERROR. The buffer then holds two entries while four are pushed.

Size the stack by op_array->last instead, which is the only safe upper bound
once the pushes and pops are no longer guaranteed to be balanced.

Assisted-By: Claude <noreply@anthropic.com>

Closes GH-23454.
* PHP-8.6:
  zend_compile: Disable `array_map()` optimization for `strict_types=1` (#23889)
* PHP-8.4:
  Fix call_stack buffer overflow in zend_analyze_calls()
* PHP-8.5:
  Fix call_stack buffer overflow in zend_analyze_calls()
* PHP-8.6:
  Fix call_stack buffer overflow in zend_analyze_calls()
@pull pull Bot locked and limited conversation to collaborators Sep 25, 2026
@pull pull Bot added the ⤵️ pull label Sep 25, 2026
@pull
pull Bot merged commit ffce4af into turkdevops:master Sep 25, 2026
0 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants