3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Destructable { private $id; function __construct($id) { $this->id = $id; } function __destruct() { echo "Goodbye ($this->id)!\n"; } } function throwaway($anything) { throw new Exception; } function do_stuff() { $parameter = new Destructable(1); $not_a_parameter = new Destructable(2); throwaway( $parameter ); } $stored_exception = null; try { do_stuff(); } catch ( Exception $e ) { echo "Caught!\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 4
Branch analysis from position: 4
2 jumps found. (Code = 107) Position 1 = 5, Position 2 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H6fDl
function name:  (null)
number of ops:  7
compiled vars:  !0 = $stored_exception, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ASSIGN                                                   !0, null
   23     1        INIT_FCALL                                               'do_stuff'
          2        DO_FCALL                                      0          
          3      > JMP                                                      ->6
   25     4  E > > CATCH                                       last         'Exception'
   27     5    >   ECHO                                                     'Caught%21%0A'
   28     6    > > RETURN                                                   1

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

End of function throwaway

Function do_stuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H6fDl
function name:  do_stuff
number of ops:  12
compiled vars:  !0 = $parameter, !1 = $not_a_parameter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $2      'Destructable'
          1        SEND_VAL_EX                                              1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   15     4        NEW                                              $5      'Destructable'
          5        SEND_VAL_EX                                              2
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   17     8        INIT_FCALL                                               'throwaway'
          9        SEND_VAR                                                 !0
         10        DO_FCALL                                      0          
   18    11      > RETURN                                                   null

End of function do_stuff

Class Destructable:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H6fDl
function name:  __construct
number of ops:  4
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'id'
          2        OP_DATA                                                  !0
          3      > RETURN                                                   null

End of function __construct

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H6fDl
function name:  __destruct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ROPE_INIT                                     3  ~2      'Goodbye+%28'
          1        FETCH_OBJ_R                                      ~0      'id'
          2        ROPE_ADD                                      1  ~2      ~2, ~0
          3        ROPE_END                                      2  ~1      ~2, '%29%21%0A'
          4        ECHO                                                     ~1
          5      > RETURN                                                   null

End of function __destruct

End of class Destructable.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.97 ms | 948 KiB | 16 Q