3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { echo "does something\n"; throw new Exception( 'exception thrown' ); } catch ( TypeError $exception ) { echo "TypeError: {$exception->getMessage()}\n"; } catch ( Exception $exception ) { echo "Exception: {$exception->getMessage()}\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
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
Found catch point at position: 14
Branch analysis from position: 14
filename:       /in/bgh1S
function name:  (null)
number of ops:  22
compiled vars:  !0 = $exception
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'does+something%0A'
    5     1        NEW                                              $1      'Exception'
          2        SEND_VAL_EX                                              'exception+thrown'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $1
          5*       JMP                                                      ->21
    6     6  E > > CATCH                                                    'TypeError', ->14
    7     7    >   ROPE_INIT                                     3  ~5      'TypeError%3A+'
          8        INIT_METHOD_CALL                                         !0, 'getMessage'
          9        DO_FCALL                                      0  $3      
         10        ROPE_ADD                                      1  ~5      ~5, $3
         11        ROPE_END                                      2  ~4      ~5, '%0A'
         12        ECHO                                                     ~4
         13      > JMP                                                      ->21
    8    14  E > > CATCH                                       last         'Exception'
    9    15    >   ROPE_INIT                                     3  ~9      'Exception%3A+'
         16        INIT_METHOD_CALL                                         !0, 'getMessage'
         17        DO_FCALL                                      0  $7      
         18        ROPE_ADD                                      1  ~9      ~9, $7
         19        ROPE_END                                      2  ~8      ~9, '%0A'
         20        ECHO                                                     ~8
   10    21    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.76 ms | 1423 KiB | 13 Q