3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ 'color' => 'red', 'taste' => 'sweet', 'shape' => 'round', 'name' => 'apple' ]; $a += ['myKey' => 'foo']; // this is added because the key doesn't exist $a += ['shape' => 'bar']; // this is ignored because the already key exists $a += ['zero']; // this is added because the 0 key doesn't exist $a += ['not zero']; // this is ignored because the 0 key already exists var_export($a);

preferences:
35.31 ms | 404 KiB | 5 Q