3v4l.org

run code in 300+ PHP versions simultaneously
<?php $my_array = array("a" => "Cat","b" => "Dog", "c" => "Horse"); $i = 1; $option = "option"; foreach($my_array as $val) { ${$option.$i} = $val; $i++; } echo "\$option1 => ".$option1." \$option2 => ".$option2." \$option3 => ".$option3;
Output for git.master, git.master_jit, rfc.property-hooks
$option1 => Cat $option2 => Dog $option3 => Horse

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