Skip to content

[pull] master from php:master#707

Merged
pull[bot] merged 14 commits intoturkdevops:masterfrom
php:master
Feb 3, 2026
Merged

[pull] master from php:master#707
pull[bot] merged 14 commits intoturkdevops:masterfrom
php:master

Conversation

@pull
Copy link

@pull pull bot commented Feb 3, 2026

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 : )

arnaud-lb and others added 14 commits February 3, 2026 11:48
A lazy object is marked non-lazy when all its properties are
initialized. Before doing so we delete the object info, resulting in a
temporarily invalid state. In GH-20657 the GC is triggered at this moment.

Fix by deleting the object info _after_ marking it non lazy.

Fixes GH-20657
Closes GH-21094
* PHP-8.4:
  Mark object non-lazy before deleting info in zend_lazy_object_realize()
* PHP-8.5:
  Mark object non-lazy before deleting info in zend_lazy_object_realize()
In GH-18039 we guard the underlying property before forwarding access
to the real instance of a lazy proxy. When the real instance lacks magic
methods, the assertion zobj->ce->ce_flags & ZEND_ACC_USE_GUARDS fails in
zend_get_property_guard().

Fix by checking that the real instance uses guards.

Fixes GH-20504
Closes GH-21093
* PHP-8.4:
  Real instance of lazy proxy may have less magic methods
* PHP-8.5:
  Real instance of lazy proxy may have less magic methods
We don't expect the lazy proxy to be modified during initialization, but
this is allowed. The modification may set a property, still marked LAZY,
without removing the LAZY flag. This causes an assertion failure in GH-20174.

Both the RFC and the documentation specify that after an initialization
failure, the state of the object is reset to its pre-initialization state:

    If the initializer throws an exception, the object state is reverted to
    its pre-initialization state and the object is marked as lazy again. In
    other words, all effects on the object itself are reverted. Other side
    effects, such as effects on other objects, are not reverted. This prevents
    exposing a partially initialized instance in case of failure.

This behavior would have prevented this issue, but it was not implemented
for lazy proxies (only for ghosts).

Fix by implementing the missing behavior.

Fixes GH-20174
Closes GH-20181
Update gen_stubs.php to generate C enums from internal enums, when the stub is annotated with @generate-c-enums. Enum values can be compared to the result of zend_enum_fetch_case_id(zend_object*).

The generated enums are added to separate files named {$extensionName}_decl.h, so that it's possible to include these from anywhere. _arginfo.h files would generate warnings if we tried to include them in a compilation unit that doesn't call the register_{$class} functions, for instance.

Introduce Z_PARAM_ENUM().

* Make ZEND_AST_CONST_ENUM_INIT a 4-children node

* Store enum case id in ZEND_AST_CONST_ENUM_INIT

* Store enum case id in instance

* Expose enum case_id internally

* Generate C enum for internal enums

* Introduce Z_PARAM_ENUM()

* Port extensions
This step regularly locks up. Maybe --verbose will provide some insight. Also
limit the step to 10 minutes to avoid holding up resources.
* PHP-8.2:
  Make brew verbose, limit to 10 minutes
* PHP-8.3:
  Make brew verbose, limit to 10 minutes
* PHP-8.4:
  Make brew verbose, limit to 10 minutes
* PHP-8.5:
  Make brew verbose, limit to 10 minutes
@pull pull bot locked and limited conversation to collaborators Feb 3, 2026
@pull pull bot added the ⤵️ pull label Feb 3, 2026
@pull pull bot merged commit 5873627 into turkdevops:master Feb 3, 2026
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.

2 participants