3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __destruct() { } } gc_disable(); $a1 = new A; $a2 = new A; $a1->ref = $a2; $a2->ref = $a1; $a1 = $a2 = NULL; echo 'removed cycles: '.gc_collect_cycles()."\n"; echo 'removed cycles: '.gc_collect_cycles()."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0LIVn
function name:  (null)
number of ops:  25
compiled vars:  !0 = $a1, !1 = $a2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'gc_disable'
          1        DO_ICALL                                                 
    9     2        NEW                                              $3      'A'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   10     5        NEW                                              $6      'A'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   12     8        ASSIGN_OBJ                                               !0, 'ref'
          9        OP_DATA                                                  !1
   13    10        ASSIGN_OBJ                                               !1, 'ref'
         11        OP_DATA                                                  !0
   15    12        ASSIGN                                           ~11     !1, null
         13        ASSIGN                                                   !0, ~11
   17    14        INIT_FCALL                                               'gc_collect_cycles'
         15        DO_ICALL                                         $13     
         16        CONCAT                                           ~14     'removed+cycles%3A+', $13
         17        CONCAT                                           ~15     ~14, '%0A'
         18        ECHO                                                     ~15
   18    19        INIT_FCALL                                               'gc_collect_cycles'
         20        DO_ICALL                                         $16     
         21        CONCAT                                           ~17     'removed+cycles%3A+', $16
         22        CONCAT                                           ~18     ~17, '%0A'
         23        ECHO                                                     ~18
         24      > RETURN                                                   1

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

End of function __destruct

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.95 ms | 1438 KiB | 15 Q