3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = []; for( $i =0 ; $i < 50000 ; $i++) { $data[] = md5('test'); } echo number_format(memory_get_usage(), 0, ',', '.')."\n"; echo number_format(memory_get_usage(true), 0, ',', '.')."\n"; unset($data); echo number_format(memory_get_usage(), 0, ',', '.')."\n"; echo number_format(memory_get_usage(true), 0, ',', '.')."\n"; class x { public $value; public function __construct($value) { $this->value = $value; } } $dataForObject = []; for( $i =0 ; $i < 50000 ; $i++) { $dataForObject[] = md5('test'); } $x = new x($dataForObject); echo number_format(memory_get_usage(), 0, ',', '.')."\n"; echo number_format(memory_get_usage(true), 0, ',', '.')."\n"; unset($dataForObject); unset($x); echo number_format(memory_get_usage(), 0, ',', '.')."\n"; echo number_format(memory_get_usage(true), 0, ',', '.');
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 = 42) Position 1 = 63
Branch analysis from position: 63
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 57
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 57
Branch analysis from position: 65
Branch analysis from position: 57
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/pV16e
function name:  (null)
number of ops:  113
compiled vars:  !0 = $data, !1 = $i, !2 = $dataForObject, !3 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->9
    4     3    >   INIT_FCALL                                               'md5'
          4        SEND_VAL                                                 'test'
          5        DO_ICALL                                         $7      
          6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  $7
    3     8        PRE_INC                                                  !1
          9    >   IS_SMALLER                                               !1, 50000
         10      > JMPNZ                                                    ~9, ->3
    7    11    >   INIT_FCALL                                               'number_format'
         12        INIT_FCALL                                               'memory_get_usage'
         13        DO_ICALL                                         $10     
         14        SEND_VAR                                                 $10
         15        SEND_VAL                                                 0
         16        SEND_VAL                                                 '%2C'
         17        SEND_VAL                                                 '.'
         18        DO_ICALL                                         $11     
         19        CONCAT                                           ~12     $11, '%0A'
         20        ECHO                                                     ~12
    8    21        INIT_FCALL                                               'number_format'
         22        INIT_FCALL                                               'memory_get_usage'
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $13     
         25        SEND_VAR                                                 $13
         26        SEND_VAL                                                 0
         27        SEND_VAL                                                 '%2C'
         28        SEND_VAL                                                 '.'
         29        DO_ICALL                                         $14     
         30        CONCAT                                           ~15     $14, '%0A'
         31        ECHO                                                     ~15
   10    32        UNSET_CV                                                 !0
   12    33        INIT_FCALL                                               'number_format'
         34        INIT_FCALL                                               'memory_get_usage'
         35        DO_ICALL                                         $16     
         36        SEND_VAR                                                 $16
         37        SEND_VAL                                                 0
         38        SEND_VAL                                                 '%2C'
         39        SEND_VAL                                                 '.'
         40        DO_ICALL                                         $17     
         41        CONCAT                                           ~18     $17, '%0A'
         42        ECHO                                                     ~18
   13    43        INIT_FCALL                                               'number_format'
         44        INIT_FCALL                                               'memory_get_usage'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $19     
         47        SEND_VAR                                                 $19
         48        SEND_VAL                                                 0
         49        SEND_VAL                                                 '%2C'
         50        SEND_VAL                                                 '.'
         51        DO_ICALL                                         $20     
         52        CONCAT                                           ~21     $20, '%0A'
         53        ECHO                                                     ~21
   23    54        ASSIGN                                                   !2, <array>
   24    55        ASSIGN                                                   !1, 0
         56      > JMP                                                      ->63
   25    57    >   INIT_FCALL                                               'md5'
         58        SEND_VAL                                                 'test'
         59        DO_ICALL                                         $25     
         60        ASSIGN_DIM                                               !2
         61        OP_DATA                                                  $25
   24    62        PRE_INC                                                  !1
         63    >   IS_SMALLER                                               !1, 50000
         64      > JMPNZ                                                    ~27, ->57
   27    65    >   NEW                                              $28     'x'
         66        SEND_VAR_EX                                              !2
         67        DO_FCALL                                      0          
         68        ASSIGN                                                   !3, $28
   29    69        INIT_FCALL                                               'number_format'
         70        INIT_FCALL                                               'memory_get_usage'
         71        DO_ICALL                                         $31     
         72        SEND_VAR                                                 $31
         73        SEND_VAL                                                 0
         74        SEND_VAL                                                 '%2C'
         75        SEND_VAL                                                 '.'
         76        DO_ICALL                                         $32     
         77        CONCAT                                           ~33     $32, '%0A'
         78        ECHO                                                     ~33
   30    79        INIT_FCALL                                               'number_format'
         80        INIT_FCALL                                               'memory_get_usage'
         81        SEND_VAL                                                 <true>
         82        DO_ICALL                                         $34     
         83        SEND_VAR                                                 $34
         84        SEND_VAL                                                 0
         85        SEND_VAL                                                 '%2C'
         86        SEND_VAL                                                 '.'
         87        DO_ICALL                                         $35     
         88        CONCAT                                           ~36     $35, '%0A'
         89        ECHO                                                     ~36
   32    90        UNSET_CV                                                 !2
   33    91        UNSET_CV                                                 !3
   35    92        INIT_FCALL                                               'number_format'
         93        INIT_FCALL                                               'memory_get_usage'
         94        DO_ICALL                                         $37     
         95        SEND_VAR                                                 $37
         96        SEND_VAL                                                 0
         97        SEND_VAL                                                 '%2C'
         98        SEND_VAL                                                 '.'
         99        DO_ICALL                                         $38     
        100        CONCAT                                           ~39     $38, '%0A'
        101        ECHO                                                     ~39
   36   102        INIT_FCALL                                               'number_format'
        103        INIT_FCALL                                               'memory_get_usage'
        104        SEND_VAL                                                 <true>
        105        DO_ICALL                                         $40     
        106        SEND_VAR                                                 $40
        107        SEND_VAL                                                 0
        108        SEND_VAL                                                 '%2C'
        109        SEND_VAL                                                 '.'
        110        DO_ICALL                                         $41     
        111        ECHO                                                     $41
        112      > RETURN                                                   1

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

End of function __construct

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.68 ms | 1404 KiB | 19 Q