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);
Output for git.master_jit, git.master
array ( 'color' => 'red', 'taste' => 'sweet', 'shape' => 'round', 'name' => 'apple', 'myKey' => 'foo', 0 => 'zero', )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
26.27 ms | 405 KiB | 5 Q