3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { function s(){ echo "before"; throw new Exception; } } $t = new T; try { echo substr($t->s(), 0, 0); echo " after"; } catch (Exception $e) { echo "caught"; }
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: 13
Branch analysis from position: 13
2 jumps found. (Code = 107) Position 1 = 14, Position 2 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BTNKY
function name:  (null)
number of ops:  16
compiled vars:  !0 = $t, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'T'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   10     3        INIT_FCALL                                               'substr'
          4        INIT_METHOD_CALL                                         !0, 's'
          5        DO_FCALL                                      0  $5      
          6        SEND_VAR                                                 $5
          7        SEND_VAL                                                 0
          8        SEND_VAL                                                 0
          9        DO_ICALL                                         $6      
         10        ECHO                                                     $6
   11    11        ECHO                                                     '+after'
         12      > JMP                                                      ->15
   12    13  E > > CATCH                                       last         'Exception'
   13    14    >   ECHO                                                     'caught'
   14    15    > > RETURN                                                   1

Class T:
Function s:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/BTNKY
function name:  s
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'before'
    4     1        NEW                                              $0      'Exception'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
    5     4*     > RETURN                                                   null

End of function s

End of class T.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.57 ms | 1395 KiB | 15 Q