3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<pre><?php echo phpversion() . "\n\n"; //* function foo($func) { $func("Johnny", 2, 3, 4); } $mfunc = function($a, $b, $c, $d) { echo "Hello, $a"; }; $sfunc = function($a) { echo "Short hello, $a"; }; foo($sfunc); //*/ ?></pre>
Output for 7.1.0
<pre>7.1.0 Short hello, Johnny</pre>
Output for 7.0.14
<pre>7.0.14 Short hello, Johnny</pre>
Output for 7.0.6
<pre>7.0.6 Short hello, Johnny</pre>
Output for 7.0.5
<pre>7.0.5 Short hello, Johnny</pre>
Output for 7.0.4
<pre>7.0.4 Short hello, Johnny</pre>
Output for 7.0.3
<pre>7.0.3 Short hello, Johnny</pre>
Output for 7.0.2
<pre>7.0.2 Short hello, Johnny</pre>
Output for 7.0.1
<pre>7.0.1 Short hello, Johnny</pre>
Output for 7.0.0
<pre>7.0.0 Short hello, Johnny</pre>
Output for hhvm-3.10.0 - 3.12.0
<pre>5.6.99-hhvm Short hello, Johnny</pre>
Output for 5.6.28
<pre>5.6.28 Short hello, Johnny</pre>
Output for 5.6.21
<pre>5.6.21 Short hello, Johnny</pre>
Output for 5.6.20
<pre>5.6.20 Short hello, Johnny</pre>
Output for 5.6.19
<pre>5.6.19 Short hello, Johnny</pre>
Output for 5.6.18
<pre>5.6.18 Short hello, Johnny</pre>
Output for 5.6.17
<pre>5.6.17 Short hello, Johnny</pre>
Output for 5.6.16
<pre>5.6.16 Short hello, Johnny</pre>
Output for 5.6.15
<pre>5.6.15 Short hello, Johnny</pre>
Output for 5.6.14
<pre>5.6.14 Short hello, Johnny</pre>
Output for 5.6.13
<pre>5.6.13 Short hello, Johnny</pre>
Output for 5.6.12
<pre>5.6.12 Short hello, Johnny</pre>
Output for 5.6.11
<pre>5.6.11 Short hello, Johnny</pre>
Output for 5.6.10
<pre>5.6.10 Short hello, Johnny</pre>
Output for 5.6.9
<pre>5.6.9 Short hello, Johnny</pre>
Output for 5.6.8
<pre>5.6.8 Short hello, Johnny</pre>
Output for 5.6.7
<pre>5.6.7 Short hello, Johnny</pre>
Output for 5.5.35
<pre>5.5.35 Short hello, Johnny</pre>
Output for 5.5.34
<pre>5.5.34 Short hello, Johnny</pre>
Output for 5.5.33
<pre>5.5.33 Short hello, Johnny</pre>
Output for 5.5.32
<pre>5.5.32 Short hello, Johnny</pre>
Output for 5.5.31
<pre>5.5.31 Short hello, Johnny</pre>
Output for 5.5.30
<pre>5.5.30 Short hello, Johnny</pre>
Output for 5.5.29
<pre>5.5.29 Short hello, Johnny</pre>
Output for 5.5.28
<pre>5.5.28 Short hello, Johnny</pre>
Output for 5.5.27
<pre>5.5.27 Short hello, Johnny</pre>
Output for 5.5.26
<pre>5.5.26 Short hello, Johnny</pre>
Output for 5.5.25
<pre>5.5.25 Short hello, Johnny</pre>
Output for 5.5.24
<pre>5.5.24 Short hello, Johnny</pre>
Output for 5.4.45
<pre>5.4.45 Short hello, Johnny</pre>
Output for 5.4.44
<pre>5.4.44 Short hello, Johnny</pre>
Output for 5.4.43
<pre>5.4.43 Short hello, Johnny</pre>
Output for 5.4.42
<pre>5.4.42 Short hello, Johnny</pre>
Output for 5.4.41
<pre>5.4.41 Short hello, Johnny</pre>
Output for 5.4.40
<pre>5.4.40 Short hello, Johnny</pre>
Output for 5.4.39
<pre>5.4.39 Short hello, Johnny</pre>
Output for 5.4.38
<pre>5.4.38 Short hello, Johnny</pre>
Output for 5.4.37
<pre>5.4.37 Short hello, Johnny</pre>
Output for 5.4.36
<pre>5.4.36 Short hello, Johnny</pre>
Output for 5.4.35
<pre>5.4.35 Short hello, Johnny</pre>
Output for 5.4.34
<pre>5.4.34 Short hello, Johnny</pre>
Output for 5.4.32
<pre>5.4.32 Short hello, Johnny</pre>
Output for 5.4.31
<pre>5.4.31 Short hello, Johnny</pre>
Output for 5.4.30
<pre>5.4.30 Short hello, Johnny</pre>
Output for 5.4.29
<pre>5.4.29 Short hello, Johnny</pre>
Output for 5.4.28
<pre>5.4.28 Short hello, Johnny</pre>
Output for 5.4.27
<pre>5.4.27 Short hello, Johnny</pre>
Output for 5.4.26
<pre>5.4.26 Short hello, Johnny</pre>
Output for 5.4.25
<pre>5.4.25 Short hello, Johnny</pre>
Output for 5.4.24
<pre>5.4.24 Short hello, Johnny</pre>
Output for 5.4.23
<pre>5.4.23 Short hello, Johnny</pre>
Output for 5.4.22
<pre>5.4.22 Short hello, Johnny</pre>
Output for 5.4.21
<pre>5.4.21 Short hello, Johnny</pre>
Output for 5.4.20
<pre>5.4.20 Short hello, Johnny</pre>
Output for 5.4.19
<pre>5.4.19 Short hello, Johnny</pre>
Output for 5.4.18
<pre>5.4.18 Short hello, Johnny</pre>
Output for 5.4.17
<pre>5.4.17 Short hello, Johnny</pre>
Output for 5.4.16
<pre>5.4.16 Short hello, Johnny</pre>
Output for 5.4.15
<pre>5.4.15 Short hello, Johnny</pre>
Output for 5.4.14
<pre>5.4.14 Short hello, Johnny</pre>
Output for 5.4.13
<pre>5.4.13 Short hello, Johnny</pre>
Output for 5.4.12
<pre>5.4.12 Short hello, Johnny</pre>
Output for 5.4.11
<pre>5.4.11 Short hello, Johnny</pre>
Output for 5.4.10
<pre>5.4.10 Short hello, Johnny</pre>
Output for 5.4.9
<pre>5.4.9 Short hello, Johnny</pre>
Output for 5.4.8
<pre>5.4.8 Short hello, Johnny</pre>
Output for 5.4.7
<pre>5.4.7 Short hello, Johnny</pre>
Output for 5.4.6
<pre>5.4.6 Short hello, Johnny</pre>
Output for 5.4.5
<pre>5.4.5 Short hello, Johnny</pre>
Output for 5.4.4
<pre>5.4.4 Short hello, Johnny</pre>
Output for 5.4.3
<pre>5.4.3 Short hello, Johnny</pre>
Output for 5.4.2
<pre>5.4.2 Short hello, Johnny</pre>
Output for 5.4.1
<pre>5.4.1 Short hello, Johnny</pre>
Output for 5.4.0
<pre>5.4.0 Short hello, Johnny</pre>
Output for 5.3.29
<pre>5.3.29 Short hello, Johnny</pre>
Output for 5.3.28
<pre>5.3.28 Short hello, Johnny</pre>
Output for 5.3.27
<pre>5.3.27 Short hello, Johnny</pre>
Output for 5.3.26
<pre>5.3.26 Short hello, Johnny</pre>
Output for 5.3.25
<pre>5.3.25 Short hello, Johnny</pre>
Output for 5.3.24
<pre>5.3.24 Short hello, Johnny</pre>
Output for 5.3.23
<pre>5.3.23 Short hello, Johnny</pre>
Output for 5.3.22
<pre>5.3.22 Short hello, Johnny</pre>
Output for 5.3.21
<pre>5.3.21 Short hello, Johnny</pre>
Output for 5.3.20
<pre>5.3.20 Short hello, Johnny</pre>
Output for 5.3.19
<pre>5.3.19 Short hello, Johnny</pre>
Output for 5.3.18
<pre>5.3.18 Short hello, Johnny</pre>
Output for 5.3.17
<pre>5.3.17 Short hello, Johnny</pre>
Output for 5.3.16
<pre>5.3.16 Short hello, Johnny</pre>
Output for 5.3.15
<pre>5.3.15 Short hello, Johnny</pre>
Output for 5.3.14
<pre>5.3.14 Short hello, Johnny</pre>
Output for 5.3.13
<pre>5.3.13 Short hello, Johnny</pre>
Output for 5.3.12
<pre>5.3.12 Short hello, Johnny</pre>
Output for 5.3.11
<pre>5.3.11 Short hello, Johnny</pre>
Output for 5.3.10
<pre>5.3.10 Short hello, Johnny</pre>
Output for 5.3.9
<pre>5.3.9 Short hello, Johnny</pre>
Output for 5.3.8
<pre>5.3.8 Short hello, Johnny</pre>
Output for 5.3.7
<pre>5.3.7 Short hello, Johnny</pre>
Output for 5.3.6
<pre>5.3.6 Short hello, Johnny</pre>
Output for 5.3.5
<pre>5.3.5 Short hello, Johnny</pre>
Output for 5.3.4
<pre>5.3.4 Short hello, Johnny</pre>
Output for 5.3.3
<pre>5.3.3 Short hello, Johnny</pre>
Output for 5.3.2
<pre>5.3.2 Short hello, Johnny</pre>
Output for 5.3.1
<pre>5.3.1 Short hello, Johnny</pre>
Output for 5.3.0
<pre>5.3.0 Short hello, Johnny</pre>
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/3gjZh on line 10
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 in /in/3gjZh on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/3gjZh on line 10
Process exited with code 255.