3v4l.org

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

End of function __construct

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.03 ms | 1396 KiB | 25 Q