<?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.'));
Warning: Undefined variable $argument in /in/3U4vT on line 4
Warning: 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.
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 7.3.32 - 7.3.33
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.
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.
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.
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