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); 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 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 9
Branch analysis from position: 9
2 jumps found. (Code = 107) Position 1 = 10, Position 2 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rDT3R
function name:  (null)
number of ops:  16
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                                               'var_dump'
          2        INIT_FCALL                                               'array_map'
          3        SEND_VAL                                                 'foo'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                                 
          8      > JMP                                                      ->15
   16     9  E > > CATCH                                       last         'Exception'
   17    10    >   INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !1, 'getMessage'
         12        DO_FCALL                                      0  $5      
         13        SEND_VAR                                                 $5
         14        DO_ICALL                                                 
   18    15    > > 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/rDT3R
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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.17 ms | 1396 KiB | 17 Q