3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; // Create empty array var_dump($array); echo "-----\n"; $array = ['abc']; // Assign the value ['abc'] (array with one element 0 => 'abc' to $array) var_dump($array); echo "-----\n"; $array[] = 'abc'; // Add a new element to the array 'abc' var_dump($array); echo "-----\n"; $array += [0 => 'NEWabc', 4 => 'anotherABC']; // Concats two arrays, but the key [0] is already existing in the left-handside array so it ignores the first value from the right hand side array and only adds the second element (key 4 is not existing) var_dump($array);
Output for git.master, git.master_jit, rfc.property-hooks
array(0) { } ----- array(1) { [0]=> string(3) "abc" } ----- array(2) { [0]=> string(3) "abc" [1]=> string(3) "abc" } ----- array(3) { [0]=> string(3) "abc" [1]=> string(3) "abc" [4]=> string(10) "anotherABC" }

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:
61 ms | 401 KiB | 8 Q