3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(); for ($i = 0; $i < 10000; $i++) { $a[$i] = 1; } $start = microtime(true); $count = count($a); for ($i = 0; $i < $count; $i++) {} echo "Completed in ", microtime(true) - $start, " Seconds\n"; $start = microtime(true); foreach ($a as $k => $v) {} echo "Completed in ", microtime(true) - $start, " Seconds\n"; $start = microtime(true); foreach ($a as $k => &$v) {} echo "Completed in ", microtime(true) - $start, " Seconds\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 16
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 34
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 34
2 jumps found. (Code = 125) Position 1 = 47, Position 2 = 50
Branch analysis from position: 47
2 jumps found. (Code = 126) Position 1 = 48, Position 2 = 50
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
Branch analysis from position: 34
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 16
Branch analysis from position: 19
Branch analysis from position: 16
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
Branch analysis from position: 3
filename:       /in/7Kvf5
function name:  (null)
number of ops:  59
compiled vars:  !0 = $a, !1 = $i, !2 = $start, !3 = $count, !4 = $v, !5 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->6
    5     3    >   ASSIGN_DIM                                               !0, !1
          4        OP_DATA                                                  1
    4     5        PRE_INC                                                  !1
          6    >   IS_SMALLER                                               !1, 10000
          7      > JMPNZ                                                    ~10, ->3
    8     8    >   INIT_FCALL                                               'microtime'
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $11     
         11        ASSIGN                                                   !2, $11
    9    12        COUNT                                            ~13     !0
         13        ASSIGN                                                   !3, ~13
   10    14        ASSIGN                                                   !1, 0
         15      > JMP                                                      ->17
         16    >   PRE_INC                                                  !1
         17    >   IS_SMALLER                                               !1, !3
         18      > JMPNZ                                                    ~17, ->16
   11    19    >   ECHO                                                     'Completed+in+'
         20        INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $18     
         23        SUB                                              ~19     $18, !2
         24        ECHO                                                     ~19
         25        ECHO                                                     '+Seconds%0A'
   13    26        INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $20     
         29        ASSIGN                                                   !2, $20
   14    30      > FE_RESET_R                                       $22     !0, ->34
         31    > > FE_FETCH_R                                       ~23     $22, !4, ->34
         32    >   ASSIGN                                                   !5, ~23
         33      > JMP                                                      ->31
         34    >   FE_FREE                                                  $22
   15    35        ECHO                                                     'Completed+in+'
         36        INIT_FCALL                                               'microtime'
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                         $25     
         39        SUB                                              ~26     $25, !2
         40        ECHO                                                     ~26
         41        ECHO                                                     '+Seconds%0A'
   17    42        INIT_FCALL                                               'microtime'
         43        SEND_VAL                                                 <true>
         44        DO_ICALL                                         $27     
         45        ASSIGN                                                   !2, $27
   18    46      > FE_RESET_RW                                      $29     !0, ->50
         47    > > FE_FETCH_RW                                      ~30     $29, !4, ->50
         48    >   ASSIGN                                                   !5, ~30
         49      > JMP                                                      ->47
         50    >   FE_FREE                                                  $29
   19    51        ECHO                                                     'Completed+in+'
         52        INIT_FCALL                                               'microtime'
         53        SEND_VAL                                                 <true>
         54        DO_ICALL                                         $32     
         55        SUB                                              ~33     $32, !2
         56        ECHO                                                     ~33
         57        ECHO                                                     '+Seconds%0A'
         58      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.78 ms | 1456 KiB | 14 Q