Repository navigation
Conversation
…ontainers Report an undefined OP_DATA only when the value is assigned, after the false to array deprecation, and never report an undefined dim before "Cannot use a scalar value as an array", matching the VM.
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.
In function JIT,
zend_jit_assign_dim_helper()read an undefined OP_DATA before checking the container type. The VM reads it only when it actually assigns, so the JIT reported warnings in a different order, or where the VM reports none:$x = 1.5; $x[0] = $undef;Error: Cannot use a scalar value as an arrayUndefined variablewarning before the Error$x = 'ab'; $x[] = $undef;Error: [] operator not supported for stringsUndefined variablewarning before the Error$x = false; $x[0] = $undef;$x = 1.5; $x[$undef] = 1;Error: Cannot use a scalar value as an arrayUndefined variablewarning before the ErrorThe helper now checks for an undefined value only on the
falsepath, after the deprecation, and no longer reports an undefined key on the scalar path. The generated JIT code is unchanged, and the helper is slightly smaller at-O2(183 instructions instead of 207 on arm64).