3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($v) { if ($v !== 2) { return $v; } throw new Exception('something bad happened'); } $data = array(1, 2, 3); set_error_handler(function ($err) { echo $err; return false; }); try { var_dump(array_map('foo', $data)); } catch (Exception $e) { var_dump($e->getMessage()); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 13
Branch analysis from position: 13
2 jumps found. (Code = 107) Position 1 = 14, Position 2 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lpnYB
function name:  (null)
number of ops:  20
compiled vars:  !0 = $data, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_FCALL                                               'set_error_handler'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FlpnYB%3A15%240'
   20     3        SEND_VAL                                                 ~3
          4        DO_ICALL                                                 
   23     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'array_map'
          7        SEND_VAL                                                 'foo'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $5      
         10        SEND_VAR                                                 $5
         11        DO_ICALL                                                 
         12      > JMP                                                      ->19
   24    13  E > > CATCH                                       last         'Exception'
   25    14    >   INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !1, 'getMessage'
         16        DO_FCALL                                      0  $7      
         17        SEND_VAR                                                 $7
         18        DO_ICALL                                                 
   26    19    > > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/lpnYB
function name:  foo
number of ops:  9
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        IS_NOT_IDENTICAL                                         !0, 2
          2      > JMPZ                                                     ~1, ->4
    6     3    > > RETURN                                                   !0
    9     4    >   NEW                                              $2      'Exception'
          5        SEND_VAL_EX                                              'something+bad+happened'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $2
   10     8*     > RETURN                                                   null

End of function foo

Function %00%7Bclosure%7D%2Fin%2FlpnYB%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lpnYB
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $err
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        ECHO                                                     !0
   19     2      > RETURN                                                   <false>
   20     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FlpnYB%3A15%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.56 ms | 1400 KiB | 19 Q