3v4l.org

run code in 300+ PHP versions simultaneously
<?php $functions = [ 'array_diff', 'array_diff_uassoc', 'array_diff_ukey', 'array_intersect_uassoc', 'array_intersect_ukey', 'array_udiff', 'array_udiff_assoc', 'array_udiff_uassoc', 'array_uintersect', 'array_uintersect_assoc', 'array_uintersect_uassoc', ]; foreach ($functions as $func) { $reflFunc = new ReflectionFunction($func); $nbParams = $reflFunc->getNumberOfParameters(); $nbRequiredParams = $reflFunc->getNumberOfRequiredParameters(); printf("$func ($nbParams params, $nbRequiredParams required) %s VARIADIC", $reflFunc->isVariadic() ? "IS" : "IS NOT"); foreach ($reflFunc->getParameters() as $i => $param) { if ($param->isVariadic()) { printf(" - PARAM #%d%s IS VARIADIC", $i + 1, $param->isOptional() ? " (Opt.)" : ""); } } echo PHP_EOL; }
Output for 8.0.0 - 8.0.12, 8.1rc1 - rc3
array_diff (2 params, 1 required) IS VARIADIC - PARAM #2 (Opt.) IS VARIADIC array_diff_uassoc (2 params, 1 required) IS VARIADIC - PARAM #2 (Opt.) IS VARIADIC array_diff_ukey (2 params, 1 required) IS VARIADIC - PARAM #2 (Opt.) IS VARIADIC array_intersect_uassoc (2 params, 1 required) IS VARIADIC - PARAM #2 (Opt.) IS VARIADIC array_intersect_ukey (2 params, 1 required) IS VARIADIC - PARAM #2 (Opt.) IS VARIADIC array_udiff (2 params, 1 required) IS VARIADIC - PARAM #2 (Opt.) IS VARIADIC array_udiff_assoc (2 params, 1 required) IS VARIADIC - PARAM #2 (Opt.) IS VARIADIC array_udiff_uassoc (2 params, 1 required) IS VARIADIC - PARAM #2 (Opt.) IS VARIADIC array_uintersect (2 params, 1 required) IS VARIADIC - PARAM #2 (Opt.) IS VARIADIC array_uintersect_assoc (2 params, 1 required) IS VARIADIC - PARAM #2 (Opt.) IS VARIADIC array_uintersect_uassoc (2 params, 1 required) IS VARIADIC - PARAM #2 (Opt.) IS VARIADIC
Output for 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.32, 7.4.0 - 7.4.25
array_diff (2 params, 2 required) IS VARIADIC - PARAM #2 IS VARIADIC array_diff_uassoc (3 params, 3 required) IS NOT VARIADIC array_diff_ukey (3 params, 3 required) IS NOT VARIADIC array_intersect_uassoc (3 params, 3 required) IS NOT VARIADIC array_intersect_ukey (3 params, 3 required) IS NOT VARIADIC array_udiff (3 params, 3 required) IS NOT VARIADIC array_udiff_assoc (3 params, 3 required) IS NOT VARIADIC array_udiff_uassoc (4 params, 4 required) IS NOT VARIADIC array_uintersect (3 params, 3 required) IS NOT VARIADIC array_uintersect_assoc (3 params, 3 required) IS NOT VARIADIC array_uintersect_uassoc (4 params, 4 required) IS NOT VARIADIC
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38
Fatal error: Call to undefined method ReflectionFunction::isVariadic() in /in/clKBH on line 21
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/clKBH on line 3
Process exited with code 255.
Output for 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/clKBH on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/clKBH on line 3
Process exited with code 255.

preferences:
67.8 ms | 539 KiB | 13 Q