Laravel seems to use this valid syntax (PHP interpreter accepts it): $this['env'] = 'some value'; as opposed to using the -> because -> would resolve to a property on the class whereas [] notation will call the \ArrayAccess methods (offsetGet(), offsetSet(), etc). Reproducible: Always Steps to Reproduce: 1. Create a file in project with these contents and allow parser to run. <?php class Test implements \ArrayAccess { private $a = array(); // ArrayAccess methods function offsetExists($key) { return array_key_exists($key, $this->a); } function offsetGet($key) { return $this->a[$key]; } function offsetSet($key, $val) { $this->a[$key] = $val; } function offsetUnset($key) { unset($this->a[$key]); } /** * @return string */ function useThisWithArraySyntax() { $this['key'] = 'some value'; } } 2. Note that $this in the useThisWithArraySyntax() method is red underlined. Actual Results: $this is incorrectly underlined as invalid syntax: 'Cannot re-assign $this' Expected Results: $this with array (bracket) notation should be considered valid syntax. It does something other than what -> (or ::) does in PHP. Real file: https://github.com/laravel/framework/blob/5.0/src/Illuminate/Foundation/Application.php#L435
I second this bug, using \ArrayAccess all the time and also Nette Framework which I use does utilize this language spec - the red underline is very confusing.
*** Bug 373414 has been marked as a duplicate of this bug. ***