fix(compiler): preserve signatures for typed property method calls - #104
Open
yavon007 wants to merge 1 commit into
Open
fix(compiler): preserve signatures for typed property method calls#104yavon007 wants to merge 1 commit into
yavon007 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(compiler): preserve signatures for typed property method calls
Calls such as
$this->target->record($events)were lowered dynamically even whentargethad a non-nullable declared project class. This bypassed the knownparameter signature: an
array &$eventsargument emitted a by-reference warningand lost its writes. It also routed eligible calls through Zend wrappers.
Materialize the property receiver once before argument evaluation, record its
declared object type, and reuse existing direct-call eligibility and argument
lowering. Do not mark the receiver as an exact runtime class; existing override,
abstract-class, visibility and magic-call handling remain in effect. Nullable and
unknown property types retain their current paths.
Validation:
array; the candidate matches PHP, including named arguments, receiver replacement
during argument evaluation, subclass dispatch, nullsafe access, getter invoked
once, and uninitialized-property errors.
calls, 29.97 → 22.63 ms median (24.5% lower). Normal dungeon, 485.27 → 473.70 ms
(2.4%); exception-heavy dungeon, 1216.81 → 1226.59 ms (no improvement).
The application-scale performance result is modest; this change primarily restores
known call signatures and removes an unnecessary runtime dispatch where the
existing devirtualizer permits it. Benchmark environment: Linux ARM64 container,
PHP 8.5.10 ZTS, PHPX
4b3a472, baseline TypePHPa1782233.