This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Overview: In PHP 7, when an anonymous object's method returns an array, it's possible to access the returned array elements directly by index (for an unkeyed array) or by key (for a keyed array). Given the following code, <?php class Produce { private $fruits = array('red'=>'apple', 'yellow'=>'banana'); private $vegetables = array('beet', 'potato', 'zucchini'); public function getFruits() { return $this->fruits; } public function getVegetables() { return $this->vegetables; } } $foo = ((new Produce())->getFruits())['yellow']; $bar = ((new Produce())->getVegetables())[1]; var_dump($foo); var_dump($bar); ?> This assignment syntax is valid beginning with PHP 7.0; the output is: string(6) "banana" string(6) "potato" (See: https://3v4l.org/9BLtr) Actual Results: NetBeans 8.2 doesn't recognize this syntax even when the project properties "PHP Version" is set to 7.0. It generates this error: Syntax error: unexpected [ after ) Expected Results: No error message, syntax recognized as valid if the project "PHP Version" setting is set to 7.0 or higher