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: ' . ($ms - microtime()) . ' ms<br>'; $ms = microtime(); $array = array(); foreach($array as $strings) { echo $strings; } echo 'Time taken: ' . ($ms - microtime()) . ' ms<br>'; $ms = microtime(); $array = array('String', 'Not String'); if (count($array) != 0) { foreach($array as $strings) { echo $strings; } } echo 'Time taken: ' . ($ms - microtime()) . ' ms<br>'; $ms = microtime(); $array = array('String', 'Not String'); foreach($array as $strings) { echo $strings; } echo 'Time taken: ' . ($ms - microtime()) . ' ms<br>';
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 = 23, Position 2 = 26
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 45
Branch analysis from position: 40
2 jumps found. (Code = 77) Position 1 = 41, Position 2 = 44
Branch analysis from position: 41
2 jumps found. (Code = 78) Position 1 = 42, Position 2 = 44
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
Branch analysis from position: 44
2 jumps found. (Code = 77) Position 1 = 56, Position 2 = 59
Branch analysis from position: 56
2 jumps found. (Code = 78) Position 1 = 57, Position 2 = 59
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
Branch analysis from position: 44
Branch analysis from position: 45
Branch analysis from position: 26
Branch analysis from position: 11
Branch analysis from position: 12
filename:       /in/ZAgcb
function name:  (null)
number of ops:  67
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     !0, $9
         15        CONCAT                                           ~11     'Time+taken%3A+', ~10
         16        CONCAT                                           ~12     ~11, '+ms%3Cbr%3E'
         17        ECHO                                                     ~12
   14    18        INIT_FCALL                                               'microtime'
         19        DO_ICALL                                         $13     
         20        ASSIGN                                                   !0, $13
   15    21        ASSIGN                                                   !1, <array>
   16    22      > FE_RESET_R                                       $16     !1, ->26
         23    > > FE_FETCH_R                                               $16, !2, ->26
   18    24    >   ECHO                                                     !2
   16    25      > JMP                                                      ->23
         26    >   FE_FREE                                                  $16
   20    27        INIT_FCALL                                               'microtime'
         28        DO_ICALL                                         $17     
         29        SUB                                              ~18     !0, $17
         30        CONCAT                                           ~19     'Time+taken%3A+', ~18
         31        CONCAT                                           ~20     ~19, '+ms%3Cbr%3E'
         32        ECHO                                                     ~20
   22    33        INIT_FCALL                                               'microtime'
         34        DO_ICALL                                         $21     
         35        ASSIGN                                                   !0, $21
   23    36        ASSIGN                                                   !1, <array>
   24    37        COUNT                                            ~24     !1
         38        IS_NOT_EQUAL                                             ~24, 0
         39      > JMPZ                                                     ~25, ->45
   26    40    > > FE_RESET_R                                       $26     !1, ->44
         41    > > FE_FETCH_R                                               $26, !2, ->44
   28    42    >   ECHO                                                     !2
   26    43      > JMP                                                      ->41
         44    >   FE_FREE                                                  $26
   31    45    >   INIT_FCALL                                               'microtime'
         46        DO_ICALL                                         $27     
         47        SUB                                              ~28     !0, $27
         48        CONCAT                                           ~29     'Time+taken%3A+', ~28
         49        CONCAT                                           ~30     ~29, '+ms%3Cbr%3E'
         50        ECHO                                                     ~30
   34    51        INIT_FCALL                                               'microtime'
         52        DO_ICALL                                         $31     
         53        ASSIGN                                                   !0, $31
   35    54        ASSIGN                                                   !1, <array>
   36    55      > FE_RESET_R                                       $34     !1, ->59
         56    > > FE_FETCH_R                                               $34, !2, ->59
   38    57    >   ECHO                                                     !2
   36    58      > JMP                                                      ->56
         59    >   FE_FREE                                                  $34
   40    60        INIT_FCALL                                               'microtime'
         61        DO_ICALL                                         $35     
         62        SUB                                              ~36     !0, $35
         63        CONCAT                                           ~37     'Time+taken%3A+', ~36
         64        CONCAT                                           ~38     ~37, '+ms%3Cbr%3E'
         65        ECHO                                                     ~38
         66      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.24 ms | 1400 KiB | 15 Q