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";
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 = 62) Position 1 = -2
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/cf4GC
function name:  (null)
number of ops:  76
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
         75      > RETURN                                                   1

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