3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.24 ms | 1460 KiB | 14 Q