[php-src] Issue #22291: AST pretty printing does not correctly handle braces in string interpolation
| From: | TimWolla | Date: | Sat, 13 Jun 2026 12:25:42 +0000 |
| Subject: | [php-src] Issue #22291: AST pretty printing does not correctly handle braces in string interpolation | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-252191@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/22291
Author: TimWolla
### Description
The following code:
```php
<?php
try {
$foo = 'abc';
var_dump("{{$foo}}");
var_dump("{$foo}");
assert(!"{{$foo}}");
} catch (Error $e) {
echo $e->getMessage(), PHP_EOL;
}
```
Resulted in this output:
```
string(5) "{abc}"
string(3) "abc"
assert(!"{$foo}")
```
But I expected this output instead:
```
string(5) "{abc}"
string(3) "abc"
assert(!"{{$foo}}")
```
### PHP Version
```plain
PHP 8.6.0-dev (cli) (built: Jun 13 2026 14:01:23) (NTS DEBUG)
Copyright © The PHP Group and Contributors
Zend Engine v4.6.0-dev, Copyright © Zend by Perforce
with Zend OPcache v8.6.0-dev, Copyright ©, by Zend by Perforce
```
### Operating System
_No response_