3v4l.org

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

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

End of function __construct

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.94 ms | 1400 KiB | 21 Q