3v4l.org

run code in 300+ PHP versions simultaneously
<?php gc_enable(); class test { public $spl; public function __construct() { $this->spl = new SplPriorityQueue(); $this->spl->insert($this, 1); } } $output = ''; $i = 0; while($i < 100) { $time = microtime(1); $test = new test(); unset($test); gc_collect_cycles(); $ouput .= sprintf('%1$04d: ', $i) . number_format(memory_get_usage()) . " B\n"; $i++; } echo $output;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 5
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 5
Branch analysis from position: 30
Branch analysis from position: 5
filename:       /in/r6dB5
function name:  (null)
number of ops:  32
compiled vars:  !0 = $output, !1 = $i, !2 = $time, !3 = $test, !4 = $ouput
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'gc_enable'
          1        DO_ICALL                                                 
   16     2        ASSIGN                                                   !0, ''
   17     3        ASSIGN                                                   !1, 0
   18     4      > JMP                                                      ->28
   19     5    >   INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 1
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !2, $8
   21     9        NEW                                              $10     'test'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !3, $10
   23    12        UNSET_CV                                                 !3
   24    13        INIT_FCALL                                               'gc_collect_cycles'
         14        DO_ICALL                                                 
   26    15        INIT_FCALL                                               'sprintf'
         16        SEND_VAL                                                 '%251%2404d%3A+'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $14     
         19        INIT_FCALL                                               'number_format'
         20        INIT_FCALL                                               'memory_get_usage'
         21        DO_ICALL                                         $15     
         22        SEND_VAR                                                 $15
         23        DO_ICALL                                         $16     
         24        CONCAT                                           ~17     $14, $16
         25        CONCAT                                           ~18     ~17, '+B%0A'
         26        ASSIGN_OP                                     8          !4, ~18
   27    27        PRE_INC                                                  !1
   18    28    >   IS_SMALLER                                               !1, 100
         29      > JMPNZ                                                    ~21, ->5
   29    30    >   ECHO                                                     !0
         31      > RETURN                                                   1

Class test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r6dB5
function name:  __construct
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'SplPriorityQueue'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'spl'
          3        OP_DATA                                                  $1
   12     4        FETCH_OBJ_R                                      ~3      'spl'
          5        INIT_METHOD_CALL                                         ~3, 'insert'
          6        FETCH_THIS                                       $4      
          7        SEND_VAR_EX                                              $4
          8        SEND_VAL_EX                                              1
          9        DO_FCALL                                      0          
   13    10      > RETURN                                                   null

End of function __construct

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.29 ms | 1400 KiB | 25 Q