3v4l.org

run code in 500+ PHP versions simultaneously
<?php $cnt = 100000; echo "range()\n"; $mc = microtime(true); for($x=0; $x<=$cnt; $x++) { foreach ([...range(1, 48), ...range(114, 118)] as $number) { #echo "$number "; } } echo round(microtime(true)-$mc,4)."\n"; # ----------------------------------- echo "for loop\n"; $mc = microtime(true); for($x=0; $x<=$cnt; $x++) { for ($y=1; $y < 118; $y++) { if (($y>=1 && $y<=48) || ($y>=115 && $y <=117)) { #echo $y . " " ; } else { // do nothing } } } echo round(microtime(true)-$mc,4)."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 8
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 63, Position 2 = 43
Branch analysis from position: 63
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 45
Branch analysis from position: 60
2 jumps found. (Code = 44) Position 1 = 63, Position 2 = 43
Branch analysis from position: 63
Branch analysis from position: 43
Branch analysis from position: 45
2 jumps found. (Code = 46) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
2 jumps found. (Code = 47) Position 1 = 50, Position 2 = 55
Branch analysis from position: 50
2 jumps found. (Code = 46) Position 1 = 52, Position 2 = 54
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 57
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 45
Branch analysis from position: 60
Branch analysis from position: 45
Branch analysis from position: 57
Branch analysis from position: 54
Branch analysis from position: 55
Branch analysis from position: 49
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 8
Branch analysis from position: 26
Branch analysis from position: 8
Branch analysis from position: 22
filename:       /in/XuQFv
function name:  (null)
number of ops:  74
compiled vars:  !0 = $cnt, !1 = $mc, !2 = $x, !3 = $number, !4 = $y
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 100000
    5     1        ECHO                                                         'range%28%29%0A'
    6     2        INIT_FCALL                                                   'microtime'
          3        SEND_VAL                                                     <true>
          4        DO_ICALL                                             $6      
          5        ASSIGN                                                       !1, $6
    7     6        ASSIGN                                                       !2, 0
          7      > JMP                                                          ->24
    9     8    >   INIT_FCALL                                                   'range'
          9        SEND_VAL                                                     1
         10        SEND_VAL                                                     48
         11        DO_ICALL                                             $9      
         12        INIT_ARRAY                                           ~10     
         13        ADD_ARRAY_UNPACK                                     ~10     $9
         14        INIT_FCALL                                                   'range'
         15        SEND_VAL                                                     114
         16        SEND_VAL                                                     118
         17        DO_ICALL                                             $11     
         18        ADD_ARRAY_UNPACK                                     ~10     $11
         19      > FE_RESET_R                                           $12     ~10, ->22
         20    > > FE_FETCH_R                                                   $12, !3, ->22
         21    > > JMP                                                          ->20
         22    >   FE_FREE                                                      $12
    7    23        PRE_INC                                                      !2
         24    >   IS_SMALLER_OR_EQUAL                                          !2, !0
         25      > JMPNZ                                                        ~14, ->8
   13    26    >   INIT_FCALL                                                   'round'
         27        INIT_FCALL                                                   'microtime'
         28        SEND_VAL                                                     <true>
         29        DO_ICALL                                             $15     
         30        SUB                                                  ~16     $15, !1
         31        SEND_VAL                                                     ~16
         32        SEND_VAL                                                     4
         33        DO_ICALL                                             $17     
         34        CONCAT                                               ~18     $17, '%0A'
         35        ECHO                                                         ~18
   17    36        ECHO                                                         'for+loop%0A'
   18    37        INIT_FCALL                                                   'microtime'
         38        SEND_VAL                                                     <true>
         39        DO_ICALL                                             $19     
         40        ASSIGN                                                       !1, $19
   19    41        ASSIGN                                                       !2, 0
         42      > JMP                                                          ->61
   22    43    >   ASSIGN                                                       !4, 1
         44      > JMP                                                          ->58
   23    45    >   IS_SMALLER_OR_EQUAL                                  ~23     1, !4
         46      > JMPZ_EX                                              ~23     ~23, ->49
         47    >   IS_SMALLER_OR_EQUAL                                  ~24     !4, 48
         48        BOOL                                                 ~23     ~24
         49    > > JMPNZ_EX                                             ~23     ~23, ->55
         50    >   IS_SMALLER_OR_EQUAL                                  ~25     115, !4
         51      > JMPZ_EX                                              ~25     ~25, ->54
         52    >   IS_SMALLER_OR_EQUAL                                  ~26     !4, 117
         53        BOOL                                                 ~25     ~26
         54    >   BOOL                                                 ~23     ~25
         55    > > JMPZ                                                         ~23, ->57
         56    > > JMP                                                          ->57
   22    57    >   PRE_INC                                                      !4
         58    >   IS_SMALLER                                                   !4, 118
         59      > JMPNZ                                                        ~28, ->45
   19    60    >   PRE_INC                                                      !2
         61    >   IS_SMALLER_OR_EQUAL                                          !2, !0
         62      > JMPNZ                                                        ~30, ->43
   31    63    >   INIT_FCALL                                                   'round'
         64        INIT_FCALL                                                   'microtime'
         65        SEND_VAL                                                     <true>
         66        DO_ICALL                                             $31     
         67        SUB                                                  ~32     $31, !1
         68        SEND_VAL                                                     ~32
         69        SEND_VAL                                                     4
         70        DO_ICALL                                             $33     
         71        CONCAT                                               ~34     $33, '%0A'
         72        ECHO                                                         ~34
         73      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.12 ms | 1103 KiB | 16 Q