3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Create function with the name defined in variable $functionName function MyFunction($argument) { return 'Argument passed is: '.$argument; } $functionName = 'MyFunction'; var_dump(MyFunction('Calling MyFunction directly.')); var_dump($functionName('Calling MyFunction with string.'));

preferences:
24.69 ms | 404 KiB | 5 Q