[php-src] Issue #9263: PHP 8.2.0beta2 emits false positive deprecation warning before fatal error for `"{$g{'h'}}"`;
| From: | TysonAndre | Date: | Sun, 07 Aug 2022 14:00:50 +0000 |
| Subject: | [php-src] Issue #9263: PHP 8.2.0beta2 emits false positive deprecation warning before fatal error for `"{$g{'h'}}"`; | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242145@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9263
Author: TysonAndre
### Description
The following code:
```php
<?php $x = "{$g{'h'}}";
```
Resulted in this output:
```
Deprecated: Using ${expr} (variable variables) in strings is deprecated, use {${expr}} instead in
php shell code on line 1
Fatal error: Array and string offset access syntax with curly braces is no longer supported in php
shell code on line 1
```
But I expected this output instead:
```
Fatal error: Array and string offset access syntax with curly braces is no longer supported in php
shell code on line 1
```
(i.e. there is no use of
${} for string interpolation)
The cause is that the constants used for ast node flags have identical values, causing this
ambiguity.
#define ZEND_DIM_ALTERNATIVE_SYNTAX (1 << 1) /* deprecated curly brace usage
*/
#define ZEND_ENCAPS_VAR_DOLLAR_CURLY_VAR_VAR (1<<1)
### PHP Version
PHP 8.2.0beta2
### Operating System
_No response_