3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo(callable $bar) { throw new \Exception; } try { foo(fn($_) => $_); } catch (\Throwable $e) { var_dump(serialize($e)); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tv1s1
function name:  (null)
number of ops:  13
compiled vars:  !0 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                                   'foo'
          1        DECLARE_LAMBDA_FUNCTION                              ~1      [0]
          2        SEND_VAL                                                     ~1
          3        DO_FCALL                                          0          
          4      > JMP                                                          ->12
   10     5  E > > CATCH                                           last         'Throwable'
   11     6    >   INIT_FCALL                                                   'var_dump'
          7        INIT_FCALL                                                   'serialize'
          8        SEND_VAR                                                     !0
          9        DO_ICALL                                             $3      
         10        SEND_VAR                                                     $3
         11        DO_ICALL                                                     
   12    12    > > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tv1s1
function name:  {closure:/in/tv1s1:8}
number of ops:  3
compiled vars:  !0 = $_
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
          1      > RETURN                                                       !0
          2*     > RETURN                                                       null

End of Dynamic Function 0

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/tv1s1
function name:  foo
number of ops:  5
compiled vars:  !0 = $bar
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        NEW                                                  $1      'Exception'
          2        DO_FCALL                                          0          
          3      > THROW                                             0          $1
    5     4*     > RETURN                                                       null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
198.5 ms | 1954 KiB | 16 Q