3v4l.org

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

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