Toggle navigation
Home
Code Snippets
Plain PHP
Doctrine
Laravel
SQL
Symfony
Unittests
Zend Framework
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
Handling empty heaps
A calendar written with IntlCalendar class
Checking if a transaction is still open in PDO
Used Versions
PHP 7.4, Zend 3.0, Symfony 4.3, Laravel 5.8, PHPUnit 8.0, Doctrine 2.10