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; }); 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 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 14
Branch analysis from position: 14
2 jumps found. (Code = 107) Position 1 = 15, Position 2 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uI20s
function name:  (null)
number of ops:  21
compiled vars:  !0 = $data, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3B'
   12     1        ASSIGN                                                   !0, <array>
   15     2        INIT_FCALL                                               'set_error_handler'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FuI20s%3A15%240'
   18     4        SEND_VAL                                                 ~3
          5        DO_ICALL                                                 
   21     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'array_map'
          8        SEND_VAL                                                 'foo'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                                 
         13      > JMP                                                      ->20
   22    14  E > > CATCH                                       last         'Exception'
   23    15    >   INIT_FCALL                                               'var_dump'
         16        INIT_METHOD_CALL                                         !1, 'getMessage'
         17        DO_FCALL                                      0  $7      
         18        SEND_VAR                                                 $7
         19        DO_ICALL                                                 
   24    20    > > 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/uI20s
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%2FuI20s%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uI20s
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $err
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        ECHO                                                     !0
   18     2      > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.39 ms | 1400 KiB | 19 Q