3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ms = microtime(); $array = array(); if (count($array) != 0) { foreach($array as $strings) { echo $strings; } } echo 'Time taken: ' . (microtime() - $ms) . ' ms<br>'."\n"; $ms = microtime(); $array = array(); foreach($array as $strings) { echo $strings; } echo 'Time taken: ' . (microtime() - $ms) . ' ms<br>'."\n"; $ms = microtime(); $array = array('String', 'Not String'); if (count($array) != 0) { foreach($array as $strings) { echo $strings; } } echo 'Time taken: ' . (microtime() - $ms) . ' ms<br>'."\n"; $ms = microtime(); $array = array('String', 'Not String'); foreach($array as $strings) { echo $strings; } echo 'Time taken: ' . (microtime() - $ms) . ' ms<br>'."\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 47
Branch analysis from position: 42
2 jumps found. (Code = 77) Position 1 = 43, Position 2 = 46
Branch analysis from position: 43
2 jumps found. (Code = 78) Position 1 = 44, Position 2 = 46
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
Branch analysis from position: 46
2 jumps found. (Code = 77) Position 1 = 59, Position 2 = 62
Branch analysis from position: 59
2 jumps found. (Code = 78) Position 1 = 60, Position 2 = 62
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
Branch analysis from position: 46
Branch analysis from position: 47
Branch analysis from position: 27
Branch analysis from position: 11
Branch analysis from position: 12
filename:       /in/MnQak
function name:  (null)
number of ops:  71
compiled vars:  !0 = $ms, !1 = $array, !2 = $strings
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        DO_ICALL                                         $3      
          2        ASSIGN                                                   !0, $3
    4     3        ASSIGN                                                   !1, <array>
    5     4        COUNT                                            ~6      !1
          5        IS_NOT_EQUAL                                             ~6, 0
          6      > JMPZ                                                     ~7, ->12
    7     7    > > FE_RESET_R                                       $8      !1, ->11
          8    > > FE_FETCH_R                                               $8, !2, ->11
    9     9    >   ECHO                                                     !2
    7    10      > JMP                                                      ->8
         11    >   FE_FREE                                                  $8
   12    12    >   INIT_FCALL                                               'microtime'
         13        DO_ICALL                                         $9      
         14        SUB                                              ~10     $9, !0
         15        CONCAT                                           ~11     'Time+taken%3A+', ~10
         16        CONCAT                                           ~12     ~11, '+ms%3Cbr%3E'
         17        CONCAT                                           ~13     ~12, '%0A'
         18        ECHO                                                     ~13
   14    19        INIT_FCALL                                               'microtime'
         20        DO_ICALL                                         $14     
         21        ASSIGN                                                   !0, $14
   15    22        ASSIGN                                                   !1, <array>
   16    23      > FE_RESET_R                                       $17     !1, ->27
         24    > > FE_FETCH_R                                               $17, !2, ->27
   18    25    >   ECHO                                                     !2
   16    26      > JMP                                                      ->24
         27    >   FE_FREE                                                  $17
   20    28        INIT_FCALL                                               'microtime'
         29        DO_ICALL                                         $18     
         30        SUB                                              ~19     $18, !0
         31        CONCAT                                           ~20     'Time+taken%3A+', ~19
         32        CONCAT                                           ~21     ~20, '+ms%3Cbr%3E'
         33        CONCAT                                           ~22     ~21, '%0A'
         34        ECHO                                                     ~22
   22    35        INIT_FCALL                                               'microtime'
         36        DO_ICALL                                         $23     
         37        ASSIGN                                                   !0, $23
   23    38        ASSIGN                                                   !1, <array>
   24    39        COUNT                                            ~26     !1
         40        IS_NOT_EQUAL                                             ~26, 0
         41      > JMPZ                                                     ~27, ->47
   26    42    > > FE_RESET_R                                       $28     !1, ->46
         43    > > FE_FETCH_R                                               $28, !2, ->46
   28    44    >   ECHO                                                     !2
   26    45      > JMP                                                      ->43
         46    >   FE_FREE                                                  $28
   31    47    >   INIT_FCALL                                               'microtime'
         48        DO_ICALL                                         $29     
         49        SUB                                              ~30     $29, !0
         50        CONCAT                                           ~31     'Time+taken%3A+', ~30
         51        CONCAT                                           ~32     ~31, '+ms%3Cbr%3E'
         52        CONCAT                                           ~33     ~32, '%0A'
         53        ECHO                                                     ~33
   34    54        INIT_FCALL                                               'microtime'
         55        DO_ICALL                                         $34     
         56        ASSIGN                                                   !0, $34
   35    57        ASSIGN                                                   !1, <array>
   36    58      > FE_RESET_R                                       $37     !1, ->62
         59    > > FE_FETCH_R                                               $37, !2, ->62
   38    60    >   ECHO                                                     !2
   36    61      > JMP                                                      ->59
         62    >   FE_FREE                                                  $37
   40    63        INIT_FCALL                                               'microtime'
         64        DO_ICALL                                         $38     
         65        SUB                                              ~39     $38, !0
         66        CONCAT                                           ~40     'Time+taken%3A+', ~39
         67        CONCAT                                           ~41     ~40, '+ms%3Cbr%3E'
         68        CONCAT                                           ~42     ~41, '%0A'
         69        ECHO                                                     ~42
         70      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.61 ms | 1405 KiB | 15 Q