Array Syntax With Curly Braces Are No More¶
Until PHP 8.4, using the array syntax with curly braces yielded a Fatal error, and a nice error message.
After that, it is downgraded to a syntax error.
PHP code¶
<?php
$x{3} = 2;
print_r($x);
?>
Before¶
PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported
Fatal error: Array and string offset access syntax with curly braces is no longer supported
After¶
PHP Parse error: syntax error, unexpected token "\{"
Parse error: syntax error, unexpected token "\{"
PHP version change¶
This behavior changed in 8.4