Even when PHPSA\CompiledExpression instance returns true in ::isArray() method call, the variable itself could contain null instead of an array value. Hence it could produce PHP warning/error on line 38 when it calls in_array() on $var->getValue()
PHP Warning: in_array() expects parameter 2 to be array, null given in vendor/ovr/phpsa/src/Compiler/Expression/ArrayDimFetch.php on line 38
Either
if (!$var->isArray()) { => if (!$var->isArray() || !is_array($var->getValue())) { on line 28 in ArrayDimFetch class
or
return $this->type === self::ARR; => return ($this->type === self::ARR && is_array($this->value)); on line 294 in CompiledExpression class
or
add certain validation on creation of CompiledExpression instance
Even when PHPSA\CompiledExpression instance returns true in ::isArray() method call, the variable itself could contain null instead of an array value. Hence it could produce PHP warning/error on line 38 when it calls in_array() on $var->getValue()
PHP Warning: in_array() expects parameter 2 to be array, null given in vendor/ovr/phpsa/src/Compiler/Expression/ArrayDimFetch.php on line 38
Either
if (!$var->isArray()) { => if (!$var->isArray() || !is_array($var->getValue())) { on line 28 in ArrayDimFetch class
or
return $this->type === self::ARR; => return ($this->type === self::ARR && is_array($this->value)); on line 294 in CompiledExpression class
or
add certain validation on creation of CompiledExpression instance
would be recommended.