3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(gc_enabled()); $objstore = new SplObjectStorage(); $a = new StdClass; $b = new StdClass; $c = new StdClass; $a->b = $b; $b->a = $a; $c->b = $b; $b->c = $c; $a = function() { $d = new StdClass; $e = new StdClass; $d->e = $e; $e->d = $d; }; $a(); $objstore->attach($a); $objstore->attach($b); $objstore->attach($c); gc_collect_cycles(); var_dump($objstore); print serialize($objstore);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fHNQG
function name:  (null)
number of ops:  48
compiled vars:  !0 = $objstore, !1 = $a, !2 = $b, !3 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'gc_enabled'
          2        DO_ICALL                                         $4      
          3        SEND_VAR                                                 $4
          4        DO_ICALL                                                 
    3     5        NEW                                              $6      'SplObjectStorage'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $6
    4     8        NEW                                              $9      'StdClass'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $9
    5    11        NEW                                              $12     'StdClass'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $12
    6    14        NEW                                              $15     'StdClass'
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !3, $15
   10    17        ASSIGN_OBJ                                               !1, 'b'
         18        OP_DATA                                                  !2
   11    19        ASSIGN_OBJ                                               !2, 'a'
         20        OP_DATA                                                  !1
   12    21        ASSIGN_OBJ                                               !3, 'b'
         22        OP_DATA                                                  !2
   13    23        ASSIGN_OBJ                                               !2, 'c'
         24        OP_DATA                                                  !3
   15    25        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FfHNQG%3A15%240'
         26        ASSIGN                                                   !1, ~22
   23    27        INIT_DYNAMIC_CALL                                        !1
         28        DO_FCALL                                      0          
   25    29        INIT_METHOD_CALL                                         !0, 'attach'
         30        SEND_VAR_EX                                              !1
         31        DO_FCALL                                      0          
   26    32        INIT_METHOD_CALL                                         !0, 'attach'
         33        SEND_VAR_EX                                              !2
         34        DO_FCALL                                      0          
   27    35        INIT_METHOD_CALL                                         !0, 'attach'
         36        SEND_VAR_EX                                              !3
         37        DO_FCALL                                      0          
   29    38        INIT_FCALL                                               'gc_collect_cycles'
         39        DO_ICALL                                                 
   31    40        INIT_FCALL                                               'var_dump'
         41        SEND_VAR                                                 !0
         42        DO_ICALL                                                 
   33    43        INIT_FCALL                                               'serialize'
         44        SEND_VAR                                                 !0
         45        DO_ICALL                                         $30     
         46        ECHO                                                     $30
         47      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FfHNQG%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fHNQG
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $d, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $2      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   17     3        NEW                                              $5      'StdClass'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   19     6        ASSIGN_OBJ                                               !0, 'e'
          7        OP_DATA                                                  !1
   20     8        ASSIGN_OBJ                                               !1, 'd'
          9        OP_DATA                                                  !0
   21    10      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FfHNQG%3A15%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.57 ms | 1400 KiB | 21 Q