3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ["a", "b", "c"]; foreach($a as $key => &$value) { var_dump($key, $value); if($value !== "Test") array_splice($a, $key, 1, ["Test", "Test2"]); var_dump($a); if(count($a) > 6) exit; }
Output for git.master, git.master_jit, rfc.property-hooks
int(0) string(1) "a" array(4) { [0]=> string(4) "Test" [1]=> string(5) "Test2" [2]=> string(1) "b" [3]=> string(1) "c" } int(3) string(1) "c" array(5) { [0]=> string(4) "Test" [1]=> string(5) "Test2" [2]=> string(1) "b" [3]=> string(4) "Test" [4]=> string(5) "Test2" } int(4) string(5) "Test2" array(6) { [0]=> string(4) "Test" [1]=> string(5) "Test2" [2]=> string(1) "b" [3]=> string(4) "Test" [4]=> string(4) "Test" [5]=> string(5) "Test2" } int(5) string(5) "Test2" array(7) { [0]=> string(4) "Test" [1]=> string(5) "Test2" [2]=> string(1) "b" [3]=> string(4) "Test" [4]=> string(4) "Test" [5]=> string(4) "Test" [6]=> string(5) "Test2" }

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:
45.29 ms | 402 KiB | 8 Q