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 (RuntimeException $e) { echo 'Caught RuntimeException: '. $e->getMessage() . PHP_EOL; } 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 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 2
Branch analysis from position: 37
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 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 2
Branch analysis from position: 37
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 = 25
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 25
2 jumps found. (Code = 107) Position 1 = 26, Position 2 = -2
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 2
Branch analysis from position: 37
Branch analysis from position: 2
Found catch point at position: 25
Branch analysis from position: 25
filename:       /in/W9BQo
function name:  (null)
number of ops:  38
compiled vars:  !0 = $i, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1
          1      > JMP                                                      ->35
    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                                                      ->31
   12    18  E > > CATCH                                                    'RuntimeException', ->25
   13    19    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         20        DO_FCALL                                      0  $8      
         21        CONCAT                                           ~9      'Caught+RuntimeException%3A+', $8
         22        CONCAT                                           ~10     ~9, '%0A'
         23        ECHO                                                     ~10
         24      > JMP                                                      ->31
   14    25  E > > CATCH                                       last         'Exception'
   15    26    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         27        DO_FCALL                                      0  $11     
         28        CONCAT                                           ~12     'Caught+exception%3A+', $11
         29        CONCAT                                           ~13     ~12, '%0A'
         30        ECHO                                                     ~13
   18    31    >   CONCAT                                           ~14     'Loop+count%3A+', !0
         32        CONCAT                                           ~15     ~14, '%0A'
         33        ECHO                                                     ~15
    2    34        PRE_INC                                                  !0
         35    >   IS_SMALLER_OR_EQUAL                                      !0, 10
         36      > JMPNZ                                                    ~17, ->2
   19    37    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.87 ms | 1399 KiB | 13 Q