[php-src] Issue #11171: PHP 8.2.6RC1 endless foreach

From: Date: Mon, 01 May 2023 10:49:51 +0000
Subject: [php-src] Issue #11171: PHP 8.2.6RC1 endless foreach
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-244315@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/11171
Author: usarise

### Description

The following code:

```php
<?php

$all = ['test'];

foreach ($all as &$item) {
  $all += [$item];
}

var_dump($all);
```

Resulted in this output:
```
array(1) {
  [0]=>
  &string(4) "test"
}
```

But I expected this output instead:
```
endless foreach
```


### PHP Version

PHP 8.2.6RC1

### Operating System

Debian 11.7


Thread (1 message)

  • usarise
« previous php.bugs (#244315) next »