3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { try { throw new \RuntimeException('Error message'); } finally { try { echo 'Start finally' . PHP_EOL; $foo = new \Foo(); echo 'End finally' . PHP_EOL; } catch (\Exception $e) { echo 'Catch in finally' . PHP_EOL; throw $e; } } } catch (\Exception $e) { echo $e->getMessage() . PHP_EOL; echo $e . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 17
Branch analysis from position: 17
2 jumps found. (Code = 107) Position 1 = 18, Position 2 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cZFD9
function name:  (null)
number of ops:  25
compiled vars:  !0 = $foo, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $3      'RuntimeException'
          1        SEND_VAL_EX                                              'Error+message'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $3
    5     4*       FAST_CALL                                                ->6
          5*       JMP                                                      ->16
    7     6*       ECHO                                                     'Start+finally%0A'
    8     7*       NEW                                              $5      'Foo'
          8*       DO_FCALL                                      0          
          9*       ASSIGN                                                   !0, $5
    9    10*       ECHO                                                     'End+finally%0A'
         11*       JMP                                                      ->15
   10    12  E > > CATCH                                       last         'Exception'
   11    13    >   ECHO                                                     'Catch+in+finally%0A'
   12    14      > THROW                                         0          !1
         15*       FAST_RET                                                 
         16*       JMP                                                      ->24
   15    17  E > > CATCH                                       last         'Exception'
   16    18    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         19        DO_FCALL                                      0  $8      
         20        CONCAT                                           ~9      $8, '%0A'
         21        ECHO                                                     ~9
   17    22        CONCAT                                           ~10     !1, '%0A'
         23        ECHO                                                     ~10
   18    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.41 ms | 1398 KiB | 13 Q