3v4l.org

run code in 300+ PHP versions simultaneously
<?php gc_enable(); var_dump(number_format(memory_get_usage(), 0, ',', '.')) . "\n"; var_dump(number_format(memory_get_usage(true), 0,',','.')) . "\n"; class x { private $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); 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 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 32
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 32
Branch analysis from position: 40
Branch analysis from position: 32
filename:       /in/2RCZf
function name:  (null)
number of ops:  101
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                                                 
    4     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'number_format'
          4        INIT_FCALL                                               'memory_get_usage'
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        SEND_VAL                                                 0
          8        SEND_VAL                                                 '%2C'
          9        SEND_VAL                                                 '.'
         10        DO_ICALL                                         $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                         $6      
         13        CONCAT                                           ~7      $6, '%0A'
         14        FREE                                                     ~7
    5    15        INIT_FCALL                                               'var_dump'
         16        INIT_FCALL                                               'number_format'
         17        INIT_FCALL                                               'memory_get_usage'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $8      
         20        SEND_VAR                                                 $8
         21        SEND_VAL                                                 0
         22        SEND_VAL                                                 '%2C'
         23        SEND_VAL                                                 '.'
         24        DO_ICALL                                         $9      
         25        SEND_VAR                                                 $9
         26        DO_ICALL                                         $10     
         27        CONCAT                                           ~11     $10, '%0A'
         28        FREE                                                     ~11
   15    29        ASSIGN                                                   !0, <array>
   16    30        ASSIGN                                                   !1, 0
         31      > JMP                                                      ->38
   17    32    >   INIT_FCALL                                               'md5'
         33        SEND_VAL                                                 'Hallo'
         34        DO_ICALL                                         $15     
         35        ASSIGN_DIM                                               !0
         36        OP_DATA                                                  $15
   16    37        PRE_INC                                                  !1
         38    >   IS_SMALLER                                               !1, 50000
         39      > JMPNZ                                                    ~17, ->32
   19    40    >   NEW                                              $18     'x'
         41        SEND_VAR_EX                                              !0
         42        DO_FCALL                                      0          
         43        ASSIGN                                                   !2, $18
   21    44        INIT_FCALL                                               'var_dump'
         45        INIT_FCALL                                               'number_format'
         46        INIT_FCALL                                               'memory_get_usage'
         47        DO_ICALL                                         $21     
         48        SEND_VAR                                                 $21
         49        SEND_VAL                                                 0
         50        SEND_VAL                                                 '%2C'
         51        SEND_VAL                                                 '.'
         52        DO_ICALL                                         $22     
         53        SEND_VAR                                                 $22
         54        DO_ICALL                                         $23     
         55        CONCAT                                           ~24     $23, '%0A'
         56        FREE                                                     ~24
   22    57        INIT_FCALL                                               'var_dump'
         58        INIT_FCALL                                               'number_format'
         59        INIT_FCALL                                               'memory_get_usage'
         60        SEND_VAL                                                 <true>
         61        DO_ICALL                                         $25     
         62        SEND_VAR                                                 $25
         63        SEND_VAL                                                 0
         64        SEND_VAL                                                 '%2C'
         65        SEND_VAL                                                 '.'
         66        DO_ICALL                                         $26     
         67        SEND_VAR                                                 $26
         68        DO_ICALL                                         $27     
         69        CONCAT                                           ~28     $27, '%0A'
         70        FREE                                                     ~28
   24    71        UNSET_CV                                                 !0
   25    72        UNSET_CV                                                 !2
   27    73        INIT_FCALL                                               'var_dump'
         74        INIT_FCALL                                               'number_format'
         75        INIT_FCALL                                               'memory_get_usage'
         76        DO_ICALL                                         $29     
         77        SEND_VAR                                                 $29
         78        SEND_VAL                                                 0
         79        SEND_VAL                                                 '%2C'
         80        SEND_VAL                                                 '.'
         81        DO_ICALL                                         $30     
         82        SEND_VAR                                                 $30
         83        DO_ICALL                                         $31     
         84        CONCAT                                           ~32     $31, '%0A'
         85        FREE                                                     ~32
   28    86        INIT_FCALL                                               'var_dump'
         87        INIT_FCALL                                               'number_format'
         88        INIT_FCALL                                               'memory_get_usage'
         89        SEND_VAL                                                 <true>
         90        DO_ICALL                                         $33     
         91        SEND_VAR                                                 $33
         92        SEND_VAL                                                 0
         93        SEND_VAL                                                 '%2C'
         94        SEND_VAL                                                 '.'
         95        DO_ICALL                                         $34     
         96        SEND_VAR                                                 $34
         97        DO_ICALL                                         $35     
         98        CONCAT                                           ~36     $35, '%0A'
         99        FREE                                                     ~36
        100      > RETURN                                                   1

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

End of function __construct

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.99 ms | 1404 KiB | 23 Q