Toggle navigation
Home
Code Snippets
Plain PHP
Doctrine
Laminas
Laravel
SQL
Symfony
Unittests
Other Libraries
Blog
Slides/Talks
@SenseException
Results of Array Spread Operator with explicit numeric keys in arrays
Code
<?php
$a
= [
1
=>
1
,
2
=>
2
];
$b
= [...
$a
,
3
=>
3
,
1
=>
4
];
dump
(
$b
);
Result
^
array:3
[
0
=>
1
1
=>
4
3
=>
3
]
More Snippets
Usage of the IntlBreakIterator
Internationalization of date formats
Using RegexIterator to filter values of collection
Used Versions
PHP 8.0, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8