3v4l.org

run code in 300+ PHP versions simultaneously
<?php function someFunc($a){ var_dump($a); throw new Exception('blaaaaaaaaaaaaaah'); }; function tryCatch($callable, ...$args){ try{ return $callable(...$args); }catch(Exception $e){ return null; //hehehe he he heh we do nothing what you gonna do he he } } tryCatch('someFunc','jjj');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gho0T
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'trycatch'
          1        SEND_VAL                                                 'someFunc'
          2        SEND_VAL                                                 'jjj'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function somefunc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/gho0T
function name:  someFunc
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    5     4        NEW                                              $2      'Exception'
          5        SEND_VAL_EX                                              'blaaaaaaaaaaaaaah'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $2
    6     8*     > RETURN                                                   null

End of function somefunc

Function trycatch:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gho0T
function name:  tryCatch
number of ops:  11
compiled vars:  !0 = $callable, !1 = $args, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV_VARIADIC                                    !1      
    9     2        INIT_DYNAMIC_CALL                                        !0
          3        SEND_UNPACK                                              !1
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      1  $3      
          6      > RETURN                                                   $3
          7*       JMP                                                      ->10
   10     8  E > > CATCH                                       last         'Exception'
   11     9    > > RETURN                                                   null
   15    10*     > RETURN                                                   null

End of function trycatch

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.43 ms | 1399 KiB | 16 Q