3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Create function with the name defined in variable $functionName $functionName = <<< EOF function MyFunction($argument) { return 'Argument passed is: '.$argument; } EOF; // var_dump(MyFunction('Calling MyFunction directly.')); var_dump($functionName('Calling MyFunction with string.'));
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: argument in /in/3U4vT on line 4 Notice: Undefined variable: argument in /in/3U4vT on line 5 Fatal error: Uncaught Error: Call to undefined function function MyFunction() { return 'Argument passed is: '.; }() in /in/3U4vT:11 Stack trace: #0 {main} thrown in /in/3U4vT on line 11
Process exited with code 255.
Output for 5.2.3 - 5.6.28
Notice: Undefined variable: argument in /in/3U4vT on line 5 Notice: Undefined variable: argument in /in/3U4vT on line 6 Fatal error: Call to undefined function function MyFunction() { return 'Argument passed is: '.; }() in /in/3U4vT on line 11
Process exited with code 255.
Output for 5.0.4 - 5.1.1, 5.1.3 - 5.2.2
Notice: Undefined variable: argument in /in/3U4vT on line 4 Notice: Undefined variable: argument in /in/3U4vT on line 6 Fatal error: Call to undefined function function MyFunction() { return 'Argument passed is: '.; }() in /in/3U4vT on line 11
Process exited with code 255.
Output for 5.1.2
Notice: Undefined variable: argument in /in/3U4vT on line 4 Notice: Undefined variable: argument in /in/3U4vT on line 6 Fatal error: Call to undefined function function MyFunction() { return 'Argument passed is: '.; }() in /in/3U4vT on line 12
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: argument in /in/3U4vT on line 4 Notice: Undefined variable: argument in /in/3U4vT on line 6 Fatal error: Call to undefined function function MyFunction() { return 'Argument passed is: '.; }() in /in/3U4vT on line 11
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: Undefined variable: argument in /in/3U4vT on line 4 Notice: Undefined variable: argument in /in/3U4vT on line 6 Fatal error: Call to undefined function: function myfunction() { return 'argument passed is: '.; }() in /in/3U4vT on line 11
Process exited with code 255.
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.4
Notice: Undefined variable: argument in /in/3U4vT on line 4 Notice: Undefined variable: argument in /in/3U4vT on line 6 Fatal error: Call to undefined function: function myfunction() { return 'argument passed is: '.; }() in /in/3U4vT on line 11
Process exited with code 255.
Output for 4.4.2
Notice: Undefined variable: argument in /in/3U4vT on line 4 Notice: Undefined variable: argument in /in/3U4vT on line 6 Fatal error: Call to undefined function: function myfunction() { return 'argument passed is: '.; }() in /in/3U4vT on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: argument in /in/3U4vT on line 4 Notice: Undefined variable: argument in /in/3U4vT on line 6 Fatal error: Call to undefined function: function myfunction() { return 'argument passed is: '.; }() in /in/3U4vT on line 11