3v4l.org

run code in 300+ PHP versions simultaneously
<?php function implode_wrapper($glue , $pieces) { return (version_compare(PHP_VERSION, '7.3.99', '>')) ? implode($glue, $pieces) : implode($pieces, $glue); } function test_func($a, $b, &$cRef) { $args = func_get_args(); echo __FUNCTION__."(".implode(",",$args) . ")\n"; $cRef+=$a; } $testdata = array( array(1,1), array(2,2), array(3,3), array(4,4) ); if(defined("E_STRICT")) ini_set("error_reporting", ini_get("error_reporting") | E_STRICT); $refTest = 10; foreach($testdata as $test) { $args = array(); foreach($test as $t) $args[] = &$t; $args[] = &$refTest; call_user_func_array("test_func", $args); }

preferences:
62.94 ms | 402 KiB | 5 Q