Skip to content

Commit 7427ed6

Browse files
committed
same for sizeof
1 parent 272fa09 commit 7427ed6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Analyser/ExprHandler/AssignHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ private function shouldKeepList(ArrayDimFetch $arrayDimFetch, Scope $scope, Type
10391039
&& $arrayDimFetch->dim->right instanceof Node\Scalar\Int_
10401040
&& $arrayDimFetch->dim->left instanceof Expr\FuncCall
10411041
&& $arrayDimFetch->dim->left->name instanceof Name
1042-
&& $arrayDimFetch->dim->left->name->toLowerString() === 'count'
1042+
&& in_array($arrayDimFetch->dim->left->name->toLowerString(), ['count', 'sizeof'], true)
10431043
&& count($arrayDimFetch->dim->left->getArgs()) === 1 // could support COUNT_RECURSIVE, COUNT_NORMAL
10441044
&& $this->isSameVariable($arrayDimFetch->var, $arrayDimFetch->dim->left->getArgs()[0]->value)
10451045
&& IntegerRangeType::fromInterval(0, null)->isSuperTypeOf($scope->getType($arrayDimFetch->dim))->yes()

0 commit comments

Comments
 (0)