I'm transitioning from 7.3 to PHP 8.0 (centOS) and going through the fun process of patching hordes of undefined array keys. It's easy, but time consuming. One new tool offered by PHP I hoped would offset this burden is the new Null Coalescing Assignment Operator ??= added in 7.4
However, any use of this operator is throwing a parse error:
PHP Parse error: syntax error, unexpected '=' in /home...
Example Code (based on PHP example linked above):
function foo(){
return 'bar';
}
$array['key'] ??= foo();
Anyone run into this / know what I'm missing?