Skip to content

Commit

Permalink
NodeScopeResolver: 10x Faster constant array processing
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and ondrejmirtes committed Jan 5, 2025
1 parent cdf5110 commit 7c281ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Analyser/NodeScopeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5771,7 +5771,10 @@ private function produceArrayDimFetchAssignValueToWrite(array $offsetTypes, Type
foreach (array_reverse($offsetTypes) as $i => $offsetType) {
/** @var Type $offsetValueType */
$offsetValueType = array_pop($offsetValueTypeStack);
if (!$offsetValueType instanceof MixedType) {
if (
!$offsetValueType instanceof MixedType
&& !$offsetValueType->isConstantArray()->yes()
) {
$types = [
new ArrayType(new MixedType(), new MixedType()),
new ObjectType(ArrayAccess::class),
Expand Down

0 comments on commit 7c281ba

Please sign in to comment.