3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Initial: ".memory_get_usage()." bytes \n"; /* prints Initial: 361400 bytes */ // let's use up some memory for ($i = 0; $i < 100000; $i++) { $array []= md5($i); } // let's remove half of the array for ($i = 0; $i < 100000; $i++) { unset($array[$i]); } echo "Final: ".memory_get_usage()." bytes \n"; /* prints Final: 885912 bytes */ echo "Peak: ".memory_get_peak_usage()." bytes \n"; /* prints Peak: 13687072 bytes */ for($i=0;$i<10000000;$i++) { } $data = getrusage(); echo "User time: ". ($data['ru_utime.tv_sec'] + $data['ru_utime.tv_usec'] / 1000000); echo "System time: ". ($data['ru_stime.tv_sec'] + $data['ru_stime.tv_usec'] / 1000000);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 7
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 17
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 33
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 33
Branch analysis from position: 36
Branch analysis from position: 33
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 17
Branch analysis from position: 21
Branch analysis from position: 17
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 7
Branch analysis from position: 15
Branch analysis from position: 7
filename:       /in/6RAS3
function name:  (null)
number of ops:  52
compiled vars:  !0 = $i, !1 = $array, !2 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        DO_ICALL                                         $3      
          2        CONCAT                                           ~4      'Initial%3A+', $3
          3        CONCAT                                           ~5      ~4, '+bytes+%0A'
          4        ECHO                                                     ~5
    8     5        ASSIGN                                                   !0, 0
          6      > JMP                                                      ->13
    9     7    >   INIT_FCALL                                               'md5'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $8      
         10        ASSIGN_DIM                                               !1
         11        OP_DATA                                                  $8
    8    12        PRE_INC                                                  !0
         13    >   IS_SMALLER                                               !0, 100000
         14      > JMPNZ                                                    ~10, ->7
   13    15    >   ASSIGN                                                   !0, 0
         16      > JMP                                                      ->19
   14    17    >   UNSET_DIM                                                !1, !0
   13    18        PRE_INC                                                  !0
         19    >   IS_SMALLER                                               !0, 100000
         20      > JMPNZ                                                    ~13, ->17
   17    21    >   INIT_FCALL                                               'memory_get_usage'
         22        DO_ICALL                                         $14     
         23        CONCAT                                           ~15     'Final%3A+', $14
         24        CONCAT                                           ~16     ~15, '+bytes+%0A'
         25        ECHO                                                     ~16
   22    26        INIT_FCALL                                               'memory_get_peak_usage'
         27        DO_ICALL                                         $17     
         28        CONCAT                                           ~18     'Peak%3A+', $17
         29        CONCAT                                           ~19     ~18, '+bytes+%0A'
         30        ECHO                                                     ~19
   26    31        ASSIGN                                                   !0, 0
         32      > JMP                                                      ->34
         33    >   PRE_INC                                                  !0
         34    >   IS_SMALLER                                               !0, 10000000
         35      > JMPNZ                                                    ~22, ->33
   30    36    >   INIT_FCALL                                               'getrusage'
         37        DO_ICALL                                         $23     
         38        ASSIGN                                                   !2, $23
   32    39        FETCH_DIM_R                                      ~25     !2, 'ru_utime.tv_sec'
   33    40        FETCH_DIM_R                                      ~26     !2, 'ru_utime.tv_usec'
         41        DIV                                              ~27     ~26, 1000000
         42        ADD                                              ~28     ~25, ~27
         43        CONCAT                                           ~29     'User+time%3A+', ~28
         44        ECHO                                                     ~29
   35    45        FETCH_DIM_R                                      ~30     !2, 'ru_stime.tv_sec'
   36    46        FETCH_DIM_R                                      ~31     !2, 'ru_stime.tv_usec'
         47        DIV                                              ~32     ~31, 1000000
         48        ADD                                              ~33     ~30, ~32
         49        CONCAT                                           ~34     'System+time%3A+', ~33
         50        ECHO                                                     ~34
         51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.46 ms | 1404 KiB | 21 Q