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

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