3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = range(1, 10000); $start_time = microtime(true); $start_memory = memory_get_peak_usage(true); reset($array); while(next($array)){ $array[key($array)] = 'foo'; } $end_time = microtime(true); $end_memory = memory_get_peak_usage(true); echo "Time: " . ($end_time - $start_time) . PHP_EOL; echo "Memory: " . ($end_memory - $start_memory) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 17
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 17
Branch analysis from position: 26
Branch analysis from position: 17
filename:       /in/1NAaN
function name:  (null)
number of ops:  43
compiled vars:  !0 = $array, !1 = $start_time, !2 = $start_memory, !3 = $end_time, !4 = $end_memory
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'range'
          1        SEND_VAL                                                     1
          2        SEND_VAL                                                     10000
          3        DO_ICALL                                             $5      
          4        ASSIGN                                                       !0, $5
    4     5        INIT_FCALL                                                   'microtime'
          6        SEND_VAL                                                     <true>
          7        DO_ICALL                                             $7      
          8        ASSIGN                                                       !1, $7
    5     9        INIT_FCALL                                                   'memory_get_peak_usage'
         10        SEND_VAL                                                     <true>
         11        DO_ICALL                                             $9      
         12        ASSIGN                                                       !2, $9
    7    13        INIT_FCALL                                                   'reset'
         14        SEND_REF                                                     !0
         15        DO_ICALL                                                     
    8    16      > JMP                                                          ->22
    9    17    >   INIT_FCALL                                                   'key'
         18        SEND_VAR                                                     !0
         19        DO_ICALL                                             $12     
         20        ASSIGN_DIM                                                   !0, $12
         21        OP_DATA                                                      'foo'
    8    22    >   INIT_FCALL                                                   'next'
         23        SEND_REF                                                     !0
         24        DO_ICALL                                             $14     
         25      > JMPNZ                                                        $14, ->17
   12    26    >   INIT_FCALL                                                   'microtime'
         27        SEND_VAL                                                     <true>
         28        DO_ICALL                                             $15     
         29        ASSIGN                                                       !3, $15
   13    30        INIT_FCALL                                                   'memory_get_peak_usage'
         31        SEND_VAL                                                     <true>
         32        DO_ICALL                                             $17     
         33        ASSIGN                                                       !4, $17
   15    34        SUB                                                  ~19     !3, !1
         35        CONCAT                                               ~20     'Time%3A+', ~19
         36        CONCAT                                               ~21     ~20, '%0A'
         37        ECHO                                                         ~21
   17    38        SUB                                                  ~22     !4, !2
         39        CONCAT                                               ~23     'Memory%3A+', ~22
         40        CONCAT                                               ~24     ~23, '%0A'
         41        ECHO                                                         ~24
         42      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.98 ms | 1208 KiB | 14 Q