3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($i = 1; $i <= 10; $i++) { try { switch ($i) { case 2: throw new Exception($i); break; case 4: throw new RuntimeException($i); break; } } catch (Exception $e) { echo 'Caught exception: '. $e->getMessage() . PHP_EOL; } echo 'Loop count: '. $i . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 2
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 2
Branch analysis from position: 30
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 18
Branch analysis from position: 18
2 jumps found. (Code = 107) Position 1 = 19, Position 2 = -2
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 2
Branch analysis from position: 30
Branch analysis from position: 2
filename:       /in/9do6M
function name:  (null)
number of ops:  31
compiled vars:  !0 = $i, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1
          1      > JMP                                                      ->28
    5     2    >   IS_EQUAL                                                 !0, 2
          3      > JMPNZ                                                    ~3, ->7
    8     4    >   IS_EQUAL                                                 !0, 4
          5      > JMPNZ                                                    ~3, ->12
          6    > > JMP                                                      ->17
    6     7    >   NEW                                              $4      'Exception'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $4
    7    11*       JMP                                                      ->17
    9    12    >   NEW                                              $6      'RuntimeException'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $6
   10    16*       JMP                                                      ->17
         17    > > JMP                                                      ->24
   12    18  E > > CATCH                                       last         'Exception'
   13    19    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         20        DO_FCALL                                      0  $8      
         21        CONCAT                                           ~9      'Caught+exception%3A+', $8
         22        CONCAT                                           ~10     ~9, '%0A'
         23        ECHO                                                     ~10
   16    24    >   CONCAT                                           ~11     'Loop+count%3A+', !0
         25        CONCAT                                           ~12     ~11, '%0A'
         26        ECHO                                                     ~12
    2    27        PRE_INC                                                  !0
         28    >   IS_SMALLER_OR_EQUAL                                      !0, 10
         29      > JMPNZ                                                    ~14, ->2
   17    30    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.8 ms | 1395 KiB | 13 Q