3v4l.org

run code in 300+ PHP versions simultaneously
<?php gc_enable(); class x { private $value; private $y; public function __construct($value) { $this->value = $value; $this->y = new y(); } } class y { } $array = array(); $objects = array(); for($i = 0; $i < 50000; $i++) { $value = md5('Hallo'); $objects[] = new x($value); $array[] = $value; } var_dump(number_format(memory_get_usage(), 0, ',', '.')) . " -- "; var_dump(number_format(memory_get_usage(true), 0,',','.')) . "\n"; unset($array); unset($objects); unset($value); var_dump(number_format(memory_get_usage(), 0, ',', '.')) . " -- "; var_dump(number_format(memory_get_usage(true), 0,',','.')) . "\n"; $array = array(); $objects = array(); for($i = 0; $i < 50000; $i++) { $value = md5('Hallo'); $objects[] = new x($value); $array[] = $value; } var_dump(number_format(memory_get_usage(), 0, ',', '.')) . " -- "; var_dump(number_format(memory_get_usage(true), 0,',','.')) . "\n"; unset($array); unset($objects); unset($value); var_dump(number_format(memory_get_usage(), 0, ',', '.')) . " -- "; var_dump(number_format(memory_get_usage(true), 0,',','.')); var_dump(get_defined_vars());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 6
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 93
Branch analysis from position: 93
2 jumps found. (Code = 44) Position 1 = 95, Position 2 = 81
Branch analysis from position: 95
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 81
2 jumps found. (Code = 44) Position 1 = 95, Position 2 = 81
Branch analysis from position: 95
Branch analysis from position: 81
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 6
Branch analysis from position: 20
Branch analysis from position: 6
filename:       /in/U8NSV
function name:  (null)
number of ops:  156
compiled vars:  !0 = $array, !1 = $objects, !2 = $i, !3 = $value
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, <array>
   20     4        ASSIGN                                                   !2, 0
          5      > JMP                                                      ->18
   21     6    >   INIT_FCALL                                               'md5'
          7        SEND_VAL                                                 'Hallo'
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !3, $8
   22    10        NEW                                              $11     'x'
         11        SEND_VAR_EX                                              !3
         12        DO_FCALL                                      0          
         13        ASSIGN_DIM                                               !1
         14        OP_DATA                                                  $11
   23    15        ASSIGN_DIM                                               !0
         16        OP_DATA                                                  !3
   20    17        PRE_INC                                                  !2
         18    >   IS_SMALLER                                               !2, 50000
         19      > JMPNZ                                                    ~15, ->6
   26    20    >   INIT_FCALL                                               'var_dump'
         21        INIT_FCALL                                               'number_format'
         22        INIT_FCALL                                               'memory_get_usage'
         23        DO_ICALL                                         $16     
         24        SEND_VAR                                                 $16
         25        SEND_VAL                                                 0
         26        SEND_VAL                                                 '%2C'
         27        SEND_VAL                                                 '.'
         28        DO_ICALL                                         $17     
         29        SEND_VAR                                                 $17
         30        DO_ICALL                                         $18     
         31        CONCAT                                           ~19     $18, '+--+'
         32        FREE                                                     ~19
   27    33        INIT_FCALL                                               'var_dump'
         34        INIT_FCALL                                               'number_format'
         35        INIT_FCALL                                               'memory_get_usage'
         36        SEND_VAL                                                 <true>
         37        DO_ICALL                                         $20     
         38        SEND_VAR                                                 $20
         39        SEND_VAL                                                 0
         40        SEND_VAL                                                 '%2C'
         41        SEND_VAL                                                 '.'
         42        DO_ICALL                                         $21     
         43        SEND_VAR                                                 $21
         44        DO_ICALL                                         $22     
         45        CONCAT                                           ~23     $22, '%0A'
         46        FREE                                                     ~23
   29    47        UNSET_CV                                                 !0
   30    48        UNSET_CV                                                 !1
   31    49        UNSET_CV                                                 !3
   33    50        INIT_FCALL                                               'var_dump'
         51        INIT_FCALL                                               'number_format'
         52        INIT_FCALL                                               'memory_get_usage'
         53        DO_ICALL                                         $24     
         54        SEND_VAR                                                 $24
         55        SEND_VAL                                                 0
         56        SEND_VAL                                                 '%2C'
         57        SEND_VAL                                                 '.'
         58        DO_ICALL                                         $25     
         59        SEND_VAR                                                 $25
         60        DO_ICALL                                         $26     
         61        CONCAT                                           ~27     $26, '+--+'
         62        FREE                                                     ~27
   34    63        INIT_FCALL                                               'var_dump'
         64        INIT_FCALL                                               'number_format'
         65        INIT_FCALL                                               'memory_get_usage'
         66        SEND_VAL                                                 <true>
         67        DO_ICALL                                         $28     
         68        SEND_VAR                                                 $28
         69        SEND_VAL                                                 0
         70        SEND_VAL                                                 '%2C'
         71        SEND_VAL                                                 '.'
         72        DO_ICALL                                         $29     
         73        SEND_VAR                                                 $29
         74        DO_ICALL                                         $30     
         75        CONCAT                                           ~31     $30, '%0A'
         76        FREE                                                     ~31
   36    77        ASSIGN                                                   !0, <array>
   37    78        ASSIGN                                                   !1, <array>
   38    79        ASSIGN                                                   !2, 0
         80      > JMP                                                      ->93
   39    81    >   INIT_FCALL                                               'md5'
         82        SEND_VAL                                                 'Hallo'
         83        DO_ICALL                                         $35     
         84        ASSIGN                                                   !3, $35
   40    85        NEW                                              $38     'x'
         86        SEND_VAR_EX                                              !3
         87        DO_FCALL                                      0          
         88        ASSIGN_DIM                                               !1
         89        OP_DATA                                                  $38
   41    90        ASSIGN_DIM                                               !0
         91        OP_DATA                                                  !3
   38    92        PRE_INC                                                  !2
         93    >   IS_SMALLER                                               !2, 50000
         94      > JMPNZ                                                    ~42, ->81
   44    95    >   INIT_FCALL                                               'var_dump'
         96        INIT_FCALL                                               'number_format'
         97        INIT_FCALL                                               'memory_get_usage'
         98        DO_ICALL                                         $43     
         99        SEND_VAR                                                 $43
        100        SEND_VAL                                                 0
        101        SEND_VAL                                                 '%2C'
        102        SEND_VAL                                                 '.'
        103        DO_ICALL                                         $44     
        104        SEND_VAR                                                 $44
        105        DO_ICALL                                         $45     
        106        CONCAT                                           ~46     $45, '+--+'
        107        FREE                                                     ~46
   45   108        INIT_FCALL                                               'var_dump'
        109        INIT_FCALL                                               'number_format'
        110        INIT_FCALL                                               'memory_get_usage'
        111        SEND_VAL                                                 <true>
        112        DO_ICALL                                         $47     
        113        SEND_VAR                                                 $47
        114        SEND_VAL                                                 0
        115        SEND_VAL                                                 '%2C'
        116        SEND_VAL                                                 '.'
        117        DO_ICALL                                         $48     
        118        SEND_VAR                                                 $48
        119        DO_ICALL                                         $49     
        120        CONCAT                                           ~50     $49, '%0A'
        121        FREE                                                     ~50
   47   122        UNSET_CV                                                 !0
   48   123        UNSET_CV                                                 !1
   49   124        UNSET_CV                                                 !3
   51   125        INIT_FCALL                                               'var_dump'
        126        INIT_FCALL                                               'number_format'
        127        INIT_FCALL                                               'memory_get_usage'
        128        DO_ICALL                                         $51     
        129        SEND_VAR                                                 $51
        130        SEND_VAL                                                 0
        131        SEND_VAL                                                 '%2C'
        132        SEND_VAL                                                 '.'
        133        DO_ICALL                                         $52     
        134        SEND_VAR                                                 $52
        135        DO_ICALL                                         $53     
        136        CONCAT                                           ~54     $53, '+--+'
        137        FREE                                                     ~54
   52   138        INIT_FCALL                                               'var_dump'
        139        INIT_FCALL                                               'number_format'
        140        INIT_FCALL                                               'memory_get_usage'
        141        SEND_VAL                                                 <true>
        142        DO_ICALL                                         $55     
        143        SEND_VAR                                                 $55
        144        SEND_VAL                                                 0
        145        SEND_VAL                                                 '%2C'
        146        SEND_VAL                                                 '.'
        147        DO_ICALL                                         $56     
        148        SEND_VAR                                                 $56
        149        DO_ICALL                                                 
   55   150        INIT_FCALL                                               'var_dump'
        151        INIT_FCALL                                               'get_defined_vars'
        152        DO_ICALL                                         $58     
        153        SEND_VAR                                                 $58
        154        DO_ICALL                                                 
        155      > RETURN                                                   1

Class x:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U8NSV
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:
162.43 ms | 1408 KiB | 25 Q