3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo{ private $that; function __construct(){ $this->that = $this; } function __destruct(){ $this->that = null; echo "destruct\n"; } } $x = new Foo(); unset($x); echo "wat";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Npcvq
function name:  (null)
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        UNSET_CV                                                 !0
   16     4        ECHO                                                     'wat'
          5      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Npcvq
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_THIS                                       ~1      
          1        ASSIGN_OBJ                                               'that'
          2        OP_DATA                                                  ~1
    7     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/Npcvq
function name:  __destruct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN_OBJ                                               'that'
          1        OP_DATA                                                  null
   10     2        ECHO                                                     'destruct%0A'
   11     3      > RETURN                                                   null

End of function __destruct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.31 ms | 944 KiB | 14 Q