3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $function = new ReflectionFunction(function( $a0, &$a1, array $a2, array &$a3, Type $a4, Type &$a5, Namespaced\Type $a6, Namespaced\Type &$a7, $a8 = 'string', &$a9 = 111, array $a10 = array('a', 'b', 'c' => 'd'), array &$a11 = null, Type $a12 = null, Type &$a13 = null, Namespaced\Type $a14 = null, Namespaced\Type &$a15 = null ){}); $parameters = $function->getParameters(); $parameters = array_map('strval', $parameters); echo implode("\n", $parameters);
based on 4EHKm
Output for 5.3.0 - 7.1.0
Parameter #0 [ <required> $a0 ] Parameter #1 [ <required> &$a1 ] Parameter #2 [ <required> array $a2 ] Parameter #3 [ <required> array &$a3 ] Parameter #4 [ <required> Type $a4 ] Parameter #5 [ <required> Type &$a5 ] Parameter #6 [ <required> Namespaced\Type $a6 ] Parameter #7 [ <required> Namespaced\Type &$a7 ] Parameter #8 [ <optional> $a8 = 'string' ] Parameter #9 [ <optional> &$a9 = 111 ] Parameter #10 [ <optional> array $a10 = Array ] Parameter #11 [ <optional> array or NULL &$a11 = NULL ] Parameter #12 [ <optional> Type or NULL $a12 = NULL ] Parameter #13 [ <optional> Type or NULL &$a13 = NULL ] Parameter #14 [ <optional> Namespaced\Type or NULL $a14 = NULL ] Parameter #15 [ <optional> Namespaced\Type or NULL &$a15 = NULL ]
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/g5elt on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/g5elt on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/g5elt on line 3
Process exited with code 255.