3v4l.org

run code in 200+ 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, $a0 = 'string', &$a1 = 111, array $a2 = array('a', 'b', 'c' => 'd'), array &$a3 = null, Type $a4 = null, Type &$a5 = null, Namespaced\Type $a6 = null, Namespaced\Type &$a7 = null ){}); $parameters = $function->getParameters(); var_dump(array_map('strval', $parameters)); $function = new ReflectionFunction(function( $a0 = ReflectionMethod::IS_FINAL ){}); $parameters = $function->getParameters(); var_dump(array_map('strval', $parameters)); $function = new ReflectionFunction(function( callable $a0, callable $a1 = null ){}); $parameters = $function->getParameters(); var_dump(array_map('strval', $parameters));
based on 0jeYu
Output for 5.3.6 - 5.6.28
array(16) { [0]=> string(31) "Parameter #0 [ <required> $a0 ]" [1]=> string(32) "Parameter #1 [ <required> &$a1 ]" [2]=> string(37) "Parameter #2 [ <required> array $a2 ]" [3]=> string(38) "Parameter #3 [ <required> array &$a3 ]" [4]=> string(36) "Parameter #4 [ <required> Type $a4 ]" [5]=> string(37) "Parameter #5 [ <required> Type &$a5 ]" [6]=> string(47) "Parameter #6 [ <required> Namespaced\Type $a6 ]" [7]=> string(48) "Parameter #7 [ <required> Namespaced\Type &$a7 ]" [8]=> string(42) "Parameter #8 [ <optional> $a0 = 'string' ]" [9]=> string(38) "Parameter #9 [ <optional> &$a1 = 111 ]" [10]=> string(46) "Parameter #10 [ <optional> array $a2 = Array ]" [11]=> string(54) "Parameter #11 [ <optional> array or NULL &$a3 = NULL ]" [12]=> string(52) "Parameter #12 [ <optional> Type or NULL $a4 = NULL ]" [13]=> string(53) "Parameter #13 [ <optional> Type or NULL &$a5 = NULL ]" [14]=> string(63) "Parameter #14 [ <optional> Namespaced\Type or NULL $a6 = NULL ]" [15]=> string(64) "Parameter #15 [ <optional> Namespaced\Type or NULL &$a7 = NULL ]" } array(1) { [0]=> string(35) "Parameter #0 [ <optional> $a0 = 4 ]" } array(2) { [0]=> string(40) "Parameter #0 [ <required> callable $a0 ]" [1]=> string(55) "Parameter #1 [ <optional> callable or NULL $a1 = NULL ]" }
Output for 5.3.5
array(16) { [0]=> string(31) "Parameter #0 [ <required> $a0 ]" [1]=> string(32) "Parameter #1 [ <required> &$a1 ]" [2]=> string(37) "Parameter #2 [ <required> array $a2 ]" [3]=> string(38) "Parameter #3 [ <required> array &$a3 ]" [4]=> string(36) "Parameter #4 [ <required> Type $a4 ]" [5]=> string(37) "Parameter #5 [ <required> Type &$a5 ]" [6]=> string(47) "Parameter #6 [ <required> Namespaced\Type $a6 ]" [7]=> string(48) "Parameter #7 [ <required> Namespaced\Type &$a7 ]" [8]=> string(40) "Parameter #8 [ <optional> $ = 'string' ]" [9]=> string(36) "Parameter #9 [ <optional> &$ = 111 ]" [10]=> string(46) "Parameter #10 [ <optional> array $` = Array ]" [11]=> string(54) "Parameter #11 [ <optional> array or NULL &$h = NULL ]" [12]=> string(52) "Parameter #12 [ <optional> Type or NULL $� = NULL ]" [13]=> string(53) "Parameter #13 [ <optional> Type or NULL &$� = NULL ]" [14]=> string(63) "Parameter #14 [ <optional> Namespaced\Type or NULL $p# = NULL ]" [15]=> string(64) "Parameter #15 [ <optional> Namespaced\Type or NULL &$0! = NULL ]" } array(1) { [0]=> string(35) "Parameter #0 [ <optional> $a0 = 4 ]" } array(2) { [0]=> string(40) "Parameter #0 [ <required> callable $a0 ]" [1]=> string(55) "Parameter #1 [ <optional> callable or NULL $a1 = NULL ]" }
Output for 5.3.4
array(16) { [0]=> string(31) "Parameter #0 [ <required> $a0 ]" [1]=> string(32) "Parameter #1 [ <required> &$a1 ]" [2]=> string(37) "Parameter #2 [ <required> array $a2 ]" [3]=> string(38) "Parameter #3 [ <required> array &$a3 ]" [4]=> string(36) "Parameter #4 [ <required> Type $a4 ]" [5]=> string(37) "Parameter #5 [ <required> Type &$a5 ]" [6]=> string(47) "Parameter #6 [ <required> Namespaced\Type $a6 ]" [7]=> string(48) "Parameter #7 [ <required> Namespaced\Type &$a7 ]" [8]=> string(40) "Parameter #8 [ <optional> $ = 'string' ]" [9]=> string(36) "Parameter #9 [ <optional> &$ = 111 ]" [10]=> string(46) "Parameter #10 [ <optional> array $`: = Array ]" [11]=> string(54) "Parameter #11 [ <optional> array or NULL &$h< = NULL ]" [12]=> string(52) "Parameter #12 [ <optional> Type or NULL $�> = NULL ]" [13]=> string(53) "Parameter #13 [ <optional> Type or NULL &$�@ = NULL ]" [14]=> string(63) "Parameter #14 [ <optional> Namespaced\Type or NULL $pC = NULL ]" [15]=> string(64) "Parameter #15 [ <optional> Namespaced\Type or NULL &$0A = NULL ]" } array(1) { [0]=> string(35) "Parameter #0 [ <optional> $a0 = 4 ]" } array(2) { [0]=> string(40) "Parameter #0 [ <required> callable $a0 ]" [1]=> string(55) "Parameter #1 [ <optional> callable or NULL $a1 = NULL ]" }
Output for 5.3.3
array(16) { [0]=> string(31) "Parameter #0 [ <required> $a0 ]" [1]=> string(32) "Parameter #1 [ <required> &$a1 ]" [2]=> string(37) "Parameter #2 [ <required> array $a2 ]" [3]=> string(38) "Parameter #3 [ <required> array &$a3 ]" [4]=> string(36) "Parameter #4 [ <required> Type $a4 ]" [5]=> string(37) "Parameter #5 [ <required> Type &$a5 ]" [6]=> string(47) "Parameter #6 [ <required> Namespaced\Type $a6 ]" [7]=> string(48) "Parameter #7 [ <required> Namespaced\Type &$a7 ]" [8]=> string(40) "Parameter #8 [ <optional> $ = 'string' ]" [9]=> string(36) "Parameter #9 [ <optional> &$ = 111 ]" [10]=> string(46) "Parameter #10 [ <optional> array $ e = Array ]" [11]=> string(54) "Parameter #11 [ <optional> array or NULL &$(g = NULL ]" [12]=> string(52) "Parameter #12 [ <optional> Type or NULL $Xi = NULL ]" [13]=> string(53) "Parameter #13 [ <optional> Type or NULL &$�k = NULL ]" [14]=> string(63) "Parameter #14 [ <optional> Namespaced\Type or NULL $0n = NULL ]" [15]=> string(64) "Parameter #15 [ <optional> Namespaced\Type or NULL &$�k = NULL ]" } array(1) { [0]=> string(35) "Parameter #0 [ <optional> $a0 = 4 ]" } array(2) { [0]=> string(40) "Parameter #0 [ <required> callable $a0 ]" [1]=> string(55) "Parameter #1 [ <optional> callable or NULL $a1 = NULL ]" }
Output for 5.3.2
array(16) { [0]=> string(31) "Parameter #0 [ <required> $a0 ]" [1]=> string(32) "Parameter #1 [ <required> &$a1 ]" [2]=> string(37) "Parameter #2 [ <required> array $a2 ]" [3]=> string(38) "Parameter #3 [ <required> array &$a3 ]" [4]=> string(36) "Parameter #4 [ <required> Type $a4 ]" [5]=> string(37) "Parameter #5 [ <required> Type &$a5 ]" [6]=> string(47) "Parameter #6 [ <required> Namespaced\Type $a6 ]" [7]=> string(48) "Parameter #7 [ <required> Namespaced\Type &$a7 ]" [8]=> string(40) "Parameter #8 [ <optional> $ = 'string' ]" [9]=> string(36) "Parameter #9 [ <optional> &$ = 111 ]" [10]=> string(46) "Parameter #10 [ <optional> array $�8 = Array ]" [11]=> string(54) "Parameter #11 [ <optional> array or NULL &$�: = NULL ]" [12]=> string(52) "Parameter #12 [ <optional> Type or NULL $= = NULL ]" [13]=> string(53) "Parameter #13 [ <optional> Type or NULL &$p? = NULL ]" [14]=> string(63) "Parameter #14 [ <optional> Namespaced\Type or NULL $�A = NULL ]" [15]=> string(64) "Parameter #15 [ <optional> Namespaced\Type or NULL &$�? = NULL ]" } array(1) { [0]=> string(35) "Parameter #0 [ <optional> $a0 = 4 ]" } array(2) { [0]=> string(40) "Parameter #0 [ <required> callable $a0 ]" [1]=> string(55) "Parameter #1 [ <optional> callable or NULL $a1 = NULL ]" }
Output for 5.3.1
array(16) { [0]=> string(31) "Parameter #0 [ <required> $a0 ]" [1]=> string(32) "Parameter #1 [ <required> &$a1 ]" [2]=> string(37) "Parameter #2 [ <required> array $a2 ]" [3]=> string(38) "Parameter #3 [ <required> array &$a3 ]" [4]=> string(36) "Parameter #4 [ <required> Type $a4 ]" [5]=> string(37) "Parameter #5 [ <required> Type &$a5 ]" [6]=> string(47) "Parameter #6 [ <required> Namespaced\Type $a6 ]" [7]=> string(48) "Parameter #7 [ <required> Namespaced\Type &$a7 ]" [8]=> string(40) "Parameter #8 [ <optional> $ = 'string' ]" [9]=> string(36) "Parameter #9 [ <optional> &$ = 111 ]" [10]=> string(46) "Parameter #10 [ <optional> array $  = Array ]" [11]=> string(54) "Parameter #11 [ <optional> array or NULL &$( = NULL ]" [12]=> string(52) "Parameter #12 [ <optional> Type or NULL $X = NULL ]" [13]=> string(53) "Parameter #13 [ <optional> Type or NULL &$� = NULL ]" [14]=> string(63) "Parameter #14 [ <optional> Namespaced\Type or NULL $0 = NULL ]" [15]=> string(64) "Parameter #15 [ <optional> Namespaced\Type or NULL &$� = NULL ]" } array(1) { [0]=> string(35) "Parameter #0 [ <optional> $a0 = 4 ]" } array(2) { [0]=> string(40) "Parameter #0 [ <required> callable $a0 ]" [1]=> string(55) "Parameter #1 [ <optional> callable or NULL $a1 = NULL ]" }
Output for 5.3.0
array(16) { [0]=> string(31) "Parameter #0 [ <required> $a0 ]" [1]=> string(32) "Parameter #1 [ <required> &$a1 ]" [2]=> string(37) "Parameter #2 [ <required> array $a2 ]" [3]=> string(38) "Parameter #3 [ <required> array &$a3 ]" [4]=> string(36) "Parameter #4 [ <required> Type $a4 ]" [5]=> string(37) "Parameter #5 [ <required> Type &$a5 ]" [6]=> string(47) "Parameter #6 [ <required> Namespaced\Type $a6 ]" [7]=> string(48) "Parameter #7 [ <required> Namespaced\Type &$a7 ]" [8]=> string(40) "Parameter #8 [ <optional> $ = 'string' ]" [9]=> string(36) "Parameter #9 [ <optional> &$ = 111 ]" [10]=> string(46) "Parameter #10 [ <optional> array $@- = Array ]" [11]=> string(54) "Parameter #11 [ <optional> array or NULL &$H/ = NULL ]" [12]=> string(52) "Parameter #12 [ <optional> Type or NULL $x1 = NULL ]" [13]=> string(53) "Parameter #13 [ <optional> Type or NULL &$�3 = NULL ]" [14]=> string(63) "Parameter #14 [ <optional> Namespaced\Type or NULL $P6 = NULL ]" [15]=> string(64) "Parameter #15 [ <optional> Namespaced\Type or NULL &$4 = NULL ]" } array(1) { [0]=> string(35) "Parameter #0 [ <optional> $a0 = 4 ]" } array(2) { [0]=> string(40) "Parameter #0 [ <required> callable $a0 ]" [1]=> string(55) "Parameter #1 [ <optional> callable or NULL $a1 = 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/t1t9e 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/t1t9e on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/t1t9e on line 3
Process exited with code 255.