[php-src] Issue #12859: Update `@` operator to apply for the next operation only
| From: | mvorisek | Date: | Sun, 03 Dec 2023 18:11:55 +0000 |
| Subject: | [php-src] Issue #12859: Update `@` operator to apply for the next operation only | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245965@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12859
Author: mvorisek
### Description
The following code:
```php
<?php
$arr = [];
$arr[0];
@strlen($arr[1]);
```
Resulted in this output:
```
Warning: Undefined array key 0 in /tmp/preview on line 5
```
But I expected this output instead:
```
Warning: Undefined array key 0 in /tmp/preview on line 5
Warning: Undefined array key 1 in /tmp/preview on line 7
```
This is a feature request to narrow the scope of the supressed error reporting for the next
operation only, not the whole expression tree. If supression of the error reporting is wanted for
the whole expression tree,
@ should be used multiple times.