[php-src] Issue #20798: HP pristatė
| From: | lyabrahymabrahym683-ops | Date: | Mon, 29 Dec 2025 08:01:03 +0000 |
| Subject: | [php-src] Issue #20798: HP pristatė | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251444@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/20798
Author: lyabrahymabrahym683-ops
### Description
### The following code:
```php
<?php
```
Resulted in this output:
```
```
But I expected this output instead:
```
```
### PHP Version
```plain
<?php
// Using short array syntax.
// Also, works with array() syntax.
$arr1 = [1, 2, 3];
$arr2 = [...$arr1]; // [1, 2, 3]
$arr3 = [0, ...$arr1]; // [0, 1, 2, 3]
$arr4 = [...$arr1, ...$arr2, 111]; // [1, 2, 3, 1, 2, 3, 111]
$arr5 = [...$arr1, ...$arr1]; // [1, 2, 3, 1, 2, 3]
function getArr() {
return ['a', 'b'];
}
$arr6 = [...getArr(), 'c' => 'd']; // ['a', 'b',
'c' => 'd']
var_dump($arr1, $arr2, $arr3, $arr4, $arr5, $arr6);
?>
```
### Operating System
_No response_