3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr_input = array(); $arr_input[1] = array("parent_id"=>"null", "name"=>"one"); $arr_input[2] = array("parent_id"=>"1", "name"=>"two"); $arr_input[3] = array("parent_id"=>"null", "name"=>"three"); $arr_input[4] = array("parent_id"=>"3", "name"=>"four"); $arr_input[5] = array("parent_id"=>"4", "name"=>"five"); $arr_input[6] = array("parent_id"=>"2", "name"=>"six"); $arr_input[7] = array("parent_id"=>"3", "name"=>"seven"); $arr_input[8] = array("parent_id"=>"2", "name"=>"eight"); $input_id = 6; // variable input echo "check;"; if(isset($arr_input[$input_id])) { echo "yes"; echo $arr_input[$input_id]['name']; $parent_id = $arr_input[$input_id]['parent_id']; while($parent_id!='null') { if(isset($arr_input[$parent_id])) { echo "/".$arr_input[$parent_id]['name']; } $parent_id = $arr_input[$parent_id]['parent_id']; } }
Output for git.master, git.master_jit, rfc.property-hooks
check;yessix/two/one

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