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
Using RegexIterator to filter values of collection
The caching part of the CachingIterator
Basic usage of PDO
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8