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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.96 ms | 1404 KiB | 15 Q