3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = range(1,100000); $start = microtime(true); foreach ($array as $key => $value) { $array[$key] += 1; // Invokes COW } $end = microtime(true); $time = $end - $start; printf("Completed in %.6f seconds\n", $time);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/mZkcC
function name:  (null)
number of ops:  27
compiled vars:  !0 = $array, !1 = $start, !2 = $value, !3 = $key, !4 = $end, !5 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 100000
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !0, $6
    3     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !1, $8
    4     9      > FE_RESET_R                                       $10     !0, ->15
         10    > > FE_FETCH_R                                       ~11     $10, !2, ->15
         11    >   ASSIGN                                                   !3, ~11
    5    12        ASSIGN_DIM_OP                +=               1          !0, !3
         13        OP_DATA                                                  1
    4    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $10
    7    16        INIT_FCALL                                               'microtime'
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $14     
         19        ASSIGN                                                   !4, $14
    8    20        SUB                                              ~16     !4, !1
         21        ASSIGN                                                   !5, ~16
    9    22        INIT_FCALL                                               'printf'
         23        SEND_VAL                                                 'Completed+in+%25.6f+seconds%0A'
         24        SEND_VAR                                                 !5
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.34 ms | 1395 KiB | 19 Q