3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Destructable { function __destruct() { echo "Goodbye!\n"; } } function throwaway($anything) { throw new Exception; } $stored_exception = null; try { $raii = new Destructable; throwaway( $raii ); } catch ( Exception $e ) { echo "Caught!\n"; $stored_exception = $e; } echo "Unsetting...\n"; unset($caught_exception);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ap1vF
function name:  (null)
number of ops:  14
compiled vars:  !0 = $stored_exception, !1 = $raii, !2 = $e, !3 = $caught_exception
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, null
   10     1        NEW                                              $5      'Destructable'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
   11     4        INIT_FCALL                                               'throwaway'
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0          
          7      > JMP                                                      ->11
   13     8  E > > CATCH                                       last         'Exception'
   15     9    >   ECHO                                                     'Caught%21%0A'
   16    10        ASSIGN                                                   !0, !2
   19    11    >   ECHO                                                     'Unsetting...%0A'
   20    12        UNSET_CV                                                 !3
         13      > RETURN                                                   1

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

End of function throwaway

Class Destructable:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ap1vF
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'Goodbye%21%0A'
          1      > RETURN                                                   null

End of function __destruct

End of class Destructable.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.07 ms | 1399 KiB | 14 Q