mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00

The ast node flag constants ZEND_DIM_ALTERNATIVE_SYNTAX and ZEND_ENCAPS_VAR_DOLLAR_CURLY_VAR_VAR node have identical values (1<<1), causing a deprecation notice to be incorrectly emitted before the fatal error for unsupported syntax. Fixes GH-9263 Explicitly check for AST_VAR/AST_DIM kind for future compatibility `AST_PROP`/`AST_METHOD_CALL` and nullsafe variants can also be found in encapsulated strings - currently they have no flags but they may have flags in the future. This also clarifies that this deprecation warning can only happen for AST_VAR/AST_DIM nodes for certain `attr` values.
6 lines
243 B
PHP
6 lines
243 B
PHP
--TEST--
|
|
Alternative offset syntax should emit only E_COMPILE_ERROR in string interpolation
|
|
--FILE--
|
|
<?php "{$g{'h'}}"; ?>
|
|
--EXPECTF--
|
|
Fatal error: Array and string offset access syntax with curly braces is no longer supported in %s on line 1
|