3v4l.org

run code in 300+ PHP versions simultaneously
<?php global $ary; class C { public $ref; public function __construct() { $this->ref = $this; } public function __destruct() { global $ary; $ary[] = $this; } } new C; gc_collect_cycles(); var_dump($ary); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DogYT
function name:  (null)
number of ops:  10
compiled vars:  !0 = $ary
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   BIND_GLOBAL                                              !0, 'ary'
   16     1        NEW                                              $1      'C'
          2        DO_FCALL                                      0          
          3        FREE                                                     $1
   17     4        INIT_FCALL                                               'gc_collect_cycles'
          5        DO_ICALL                                                 
   19     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   21     9      > RETURN                                                   1

Class C:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DogYT
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_THIS                                       ~1      
          1        ASSIGN_OBJ                                               'ref'
          2        OP_DATA                                                  ~1
    9     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/DogYT
function name:  __destruct
number of ops:  5
compiled vars:  !0 = $ary
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   BIND_GLOBAL                                              !0, 'ary'
   12     1        FETCH_THIS                                       ~2      
          2        ASSIGN_DIM                                               !0
          3        OP_DATA                                                  ~2
   13     4      > RETURN                                                   null

End of function __destruct

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.31 ms | 1395 KiB | 17 Q