Skip to content

fix erroneous type inference for static class fields of array type - #1667

Merged
apolyakov merged 1 commit into
masterfrom
apolyakov/fix-wrong-array-type-inference
Aug 3, 2026
Merged

fix erroneous type inference for static class fields of array type#1667
apolyakov merged 1 commit into
masterfrom
apolyakov/fix-wrong-array-type-inference

Conversation

@apolyakov

Copy link
Copy Markdown
Contributor

A static field's init value is stored in php globals and is reset via hard_reset_var() on every request startup, where memory allocations are forbidden; its constant initializer must therefore have exactly the same C++ type as the field itself (otherwise a converting copy_from() is generated, which allocates memory and crashes)

A static field's init value is stored in php globals and is reset via
hard_reset_var() on every request startup, where memory allocations are
forbidden; its constant initializer must therefore have exactly the same C++
type as the field itself (otherwise a converting copy_from() is generated,
which allocates memory and crashes)
@apolyakov apolyakov added this to the next milestone Aug 1, 2026
@apolyakov apolyakov self-assigned this Aug 1, 2026
@apolyakov apolyakov added bug Something isn't working compiler Feature related to compiler k2 Affects compiler or runtime in K2 mode kphp Affects compiler or runtime in default mode (not K2) labels Aug 1, 2026
@apolyakov
apolyakov requested review from DrDet and PetrShumilov August 3, 2026 08:47

@PetrShumilov PetrShumilov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@apolyakov
apolyakov merged commit f6341ba into master Aug 3, 2026
8 of 11 checks passed
@apolyakov
apolyakov deleted the apolyakov/fix-wrong-array-type-inference branch August 3, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compiler Feature related to compiler k2 Affects compiler or runtime in K2 mode kphp Affects compiler or runtime in default mode (not K2)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants