3v4l.org

run code in 300+ PHP versions simultaneously
<?php function create($foo) { $bar = new stdClass; $foo->bar = $bar; $bar->foo = $foo; } gc_collect_cycles(); create(new stdClass()); var_dump(gc_collect_cycles()); // expected '2', actual '2' create(new ArrayObject()); var_dump(gc_collect_cycles()); // expected '2', actual '0'
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LQ2Uv
function name:  (null)
number of ops:  23
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'gc_collect_cycles'
          1        DO_ICALL                                                 
   11     2        INIT_FCALL                                               'create'
          3        NEW                                              $1      'stdClass'
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $1
          6        DO_FCALL                                      0          
   12     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'gc_collect_cycles'
          9        DO_ICALL                                         $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                                 
   14    12        INIT_FCALL                                               'create'
         13        NEW                                              $6      'ArrayObject'
         14        DO_FCALL                                      0          
         15        SEND_VAR                                                 $6
         16        DO_FCALL                                      0          
   15    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'gc_collect_cycles'
         19        DO_ICALL                                         $9      
         20        SEND_VAR                                                 $9
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LQ2Uv
function name:  create
number of ops:  9
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        NEW                                              $2      'stdClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $2
    5     4        ASSIGN_OBJ                                               !0, 'bar'
          5        OP_DATA                                                  !1
    6     6        ASSIGN_OBJ                                               !1, 'foo'
          7        OP_DATA                                                  !0
    7     8      > RETURN                                                   null

End of function create

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.43 ms | 1399 KiB | 19 Q