3v4l.org

run code in 300+ PHP versions simultaneously
<?php gc_enable(); class x { public $value; public $y; public function __construct($value) { $this->value = $value; $this->y = new y(); } } class y { } $array = array(); for($i = 0; $i < 50000; $i++) { $array[] = new x(md5('Hallo')); } var_dump(number_format(memory_get_usage(), 0, ',', '.')) . "\n"; var_dump(number_format(memory_get_usage(true), 0,',','.')) . "\n"; unset($array); var_dump(gc_collect_cycles()) . "\n"; var_dump(number_format(memory_get_usage(), 0, ',', '.')) . "\n"; var_dump(number_format(memory_get_usage(true), 0,',','.')) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
Branch analysis from position: 5
filename:       /in/ILQCK
function name:  (null)
number of ops:  79
compiled vars:  !0 = $array, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'gc_enable'
          1        DO_ICALL                                                 
   18     2        ASSIGN                                                   !0, <array>
   19     3        ASSIGN                                                   !1, 0
          4      > JMP                                                      ->14
   20     5    >   NEW                                              $6      'x'
          6        INIT_FCALL                                               'md5'
          7        SEND_VAL                                                 'Hallo'
          8        DO_ICALL                                         $7      
          9        SEND_VAR_NO_REF_EX                                       $7
         10        DO_FCALL                                      0          
         11        ASSIGN_DIM                                               !0
         12        OP_DATA                                                  $6
   19    13        PRE_INC                                                  !1
         14    >   IS_SMALLER                                               !1, 50000
         15      > JMPNZ                                                    ~10, ->5
   23    16    >   INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'number_format'
         18        INIT_FCALL                                               'memory_get_usage'
         19        DO_ICALL                                         $11     
         20        SEND_VAR                                                 $11
         21        SEND_VAL                                                 0
         22        SEND_VAL                                                 '%2C'
         23        SEND_VAL                                                 '.'
         24        DO_ICALL                                         $12     
         25        SEND_VAR                                                 $12
         26        DO_ICALL                                         $13     
         27        CONCAT                                           ~14     $13, '%0A'
         28        FREE                                                     ~14
   24    29        INIT_FCALL                                               'var_dump'
         30        INIT_FCALL                                               'number_format'
         31        INIT_FCALL                                               'memory_get_usage'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $15     
         34        SEND_VAR                                                 $15
         35        SEND_VAL                                                 0
         36        SEND_VAL                                                 '%2C'
         37        SEND_VAL                                                 '.'
         38        DO_ICALL                                         $16     
         39        SEND_VAR                                                 $16
         40        DO_ICALL                                         $17     
         41        CONCAT                                           ~18     $17, '%0A'
         42        FREE                                                     ~18
   26    43        UNSET_CV                                                 !0
   27    44        INIT_FCALL                                               'var_dump'
         45        INIT_FCALL                                               'gc_collect_cycles'
         46        DO_ICALL                                         $19     
         47        SEND_VAR                                                 $19
         48        DO_ICALL                                         $20     
         49        CONCAT                                           ~21     $20, '%0A'
         50        FREE                                                     ~21
   29    51        INIT_FCALL                                               'var_dump'
         52        INIT_FCALL                                               'number_format'
         53        INIT_FCALL                                               'memory_get_usage'
         54        DO_ICALL                                         $22     
         55        SEND_VAR                                                 $22
         56        SEND_VAL                                                 0
         57        SEND_VAL                                                 '%2C'
         58        SEND_VAL                                                 '.'
         59        DO_ICALL                                         $23     
         60        SEND_VAR                                                 $23
         61        DO_ICALL                                         $24     
         62        CONCAT                                           ~25     $24, '%0A'
         63        FREE                                                     ~25
   30    64        INIT_FCALL                                               'var_dump'
         65        INIT_FCALL                                               'number_format'
         66        INIT_FCALL                                               'memory_get_usage'
         67        SEND_VAL                                                 <true>
         68        DO_ICALL                                         $26     
         69        SEND_VAR                                                 $26
         70        SEND_VAL                                                 0
         71        SEND_VAL                                                 '%2C'
         72        SEND_VAL                                                 '.'
         73        DO_ICALL                                         $27     
         74        SEND_VAR                                                 $27
         75        DO_ICALL                                         $28     
         76        CONCAT                                           ~29     $28, '%0A'
         77        FREE                                                     ~29
         78      > RETURN                                                   1

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

End of function __construct

End of class x.

Class y: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.46 ms | 1404 KiB | 25 Q