Skip to content

Commit 7c281ba

Browse files
staabmondrejmirtes
authored andcommitted
NodeScopeResolver: 10x Faster constant array processing
1 parent cdf5110 commit 7c281ba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/Analyser/NodeScopeResolver.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -5771,7 +5771,10 @@ private function produceArrayDimFetchAssignValueToWrite(array $offsetTypes, Type
57715771
foreach (array_reverse($offsetTypes) as $i => $offsetType) {
57725772
/** @var Type $offsetValueType */
57735773
$offsetValueType = array_pop($offsetValueTypeStack);
5774-
if (!$offsetValueType instanceof MixedType) {
5774+
if (
5775+
!$offsetValueType instanceof MixedType
5776+
&& !$offsetValueType->isConstantArray()->yes()
5777+
) {
57755778
$types = [
57765779
new ArrayType(new MixedType(), new MixedType()),
57775780
new ObjectType(ArrayAccess::class),

0 commit comments

Comments
 (0)