3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array(1, 2, 3, 4, 5); foreach($a as $n) { echo "$n"; if ($n == 4) { $a = array_merge($a, array(6, 7)); } } $a = array(1, 2, 3, 4, 5); foreach($a as $n) { echo "$n"; if ($n == 4) { $a[] = 6; $a[] = 7; } } $a = array(1, 2, 3, 4, 5); foreach($a as $n) { echo "$n"; if ($n == 4) { array_push($a, 6); array_push($a, 7); } } $a = array(1, 2, 3, 4, 5); foreach($a as $n) { echo "$n"; if ($n == 4) { array_push($a, 6, 7); } } $a = array(1, 2, 3, 4, 5); foreach($a as $n) { echo "$n"; if ($n == 4) { array_push($a, array(6, 7)); } }
based on 87AV3

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
1234512345123451234512345
Output for Array change keys
1234512345123451234512345
Output for Lexical anon
1234512345123451234512345

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