3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decartProduct($one, $two) { $result = []; for($i=0; $i<count($one); $i++) { for($j=0; $j<count($two); $j++) { if(1) { $result[]=array_merge((array)$one[$i], (array)$two[$j]); } } } return $result; } function createAssotiation() { $args = func_get_args(); if(!count($args)) { return []; } $result = array_shift($args); while($array=array_shift($args)) { $result=decartProduct($result, $array); } return $result; } $i[0] = ['a', 'b', 'c']; $i[1] = ['d', 'e']; $i[2] = ['a', 'b', 'c']; $i[3] = ['d', 'e']; $i[4] = ['f', 'g', 'h']; $result = call_user_func_array('reateAssotiacion', $i); var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "reateAssotiacion" not found or invalid function name in /in/qkFkg:39 Stack trace: #0 {main} thrown in /in/qkFkg on line 39
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:
38.89 ms | 401 KiB | 8 Q