3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Create an array with 0 value $array = array(0); // Iterate over the array, var_dump each value // At the same time, set the next value to "lolcats" foreach ($array as $key => &$val) { var_dump($val); if($key < 10) { $array[++$key] = "lolcats"; } } // Finally var_dump the $array var_dump($array);
Output for git.master, git.master_jit, rfc.property-hooks
int(0) string(7) "lolcats" string(7) "lolcats" string(7) "lolcats" string(7) "lolcats" string(7) "lolcats" string(7) "lolcats" string(7) "lolcats" string(7) "lolcats" string(7) "lolcats" string(7) "lolcats" array(11) { [0]=> int(0) [1]=> string(7) "lolcats" [2]=> string(7) "lolcats" [3]=> string(7) "lolcats" [4]=> string(7) "lolcats" [5]=> string(7) "lolcats" [6]=> string(7) "lolcats" [7]=> string(7) "lolcats" [8]=> string(7) "lolcats" [9]=> string(7) "lolcats" [10]=> &string(7) "lolcats" }

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