3v4l.org

run code in 300+ PHP versions simultaneously
<?php function create($foo) { $foo->setFlags(ArrayObject::STD_PROP_LIST); $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/CuUir
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'gc_collect_cycles'
          1        DO_ICALL                                                 
   15     2        INIT_FCALL                                               'create'
          3        NEW                                              $1      'ArrayObject'
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $1
          6        DO_FCALL                                      0          
   16     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'gc_collect_cycles'
          9        DO_ICALL                                         $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

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

End of function create

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.5 ms | 1398 KiB | 18 Q