3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array(1,2,3); foreach($a AS &$y) { $y = $y*2; } echo $y , PHP_EOL; foreach($a AS $y) { echo $y.', '; } echo PHP_EOL, $y , PHP_EOL; foreach($a AS $x) { echo $x.', '; } echo PHP_EOL, $x , PHP_EOL;
based on Srh3B

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
6 2, 4, 4, 4 2, 4, 4, 4
Output for Array change keys
6 2, 4, 4, 4 2, 4, 4, 4
Output for Lexical anon
6 2, 4, 4, 4 2, 4, 4, 4

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