fork download
  1. <?php
  2.  
  3. function run($fun) {
  4.  
  5. try{
  6. $fun();
  7. }
  8. catch (Exception $e) {
  9. echo $e->getMessage();
  10. }
  11. }
  12.  
  13. run('myFirst');
  14. run('mySecond');
  15. run('myThird');
  16.  
  17.  
  18. function myFirst() {
  19. echo "My first method\n";
  20. }
  21.  
  22. function mySecond() {
  23. echo "My second method\n";
  24. }
  25.  
  26. function myThird() {
  27. echo "My third method\n";
  28. }
Success #stdin #stdout 0.01s 24484KB
stdin
Standard input is empty
stdout
My first method
My second method
My third method