3v4l.org

run code in 300+ PHP versions simultaneously
<?php $root = array_map(function($v) { return 'cat'.$v; }, range(1,10)); //array( 1=>'cat1', 2=>'cat2', 3=>'cat3' ); $child_1 = array_map(function($v) { return 'sub_cat'.$v; },range(1,16)); //array( 1=>'sub_cat1', 2=>'sub_cat2', 3=>'sub_cat3' ); $child_2 = array_map(function($v) { return 'sub_sub_cat'.$v; },range(1.30)); //array( 1=>'sub_sub_cat1', 2=>'sub_sub_cat2', 3=>'sub_sub_cat3' ); function getAllCombinationsArray($root, $child_1, $child_2){ $return = array(); foreach($root as $fk => $fv){ foreach($child_1 as $ck => $cv){ $cid = $fk.'_'.$ck; $cname = $fv.' -> '.$cv; foreach($child_2 as $ck2 => $cv2){ $id = $cid.'_'.$ck2; $name = $cname.' -> '.$cv2; $return[$id] = $name; } } } return $return; } print_r(getAllCombinationsArray($root, $child_1, $child_2));
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: range() expects at least 2 arguments, 1 given in /in/nfJbg:5 Stack trace: #0 /in/nfJbg(5): range(1.3) #1 {main} thrown in /in/nfJbg on line 5
Process exited with code 255.

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