3v4l.org

run code in 300+ PHP versions simultaneously
<?php $limit = 100000; $t0 = microtime(true); for ($i = 0; $i < $limit; ++$i) { $j = $i % 10 === 0; } echo microtime(true) - $t0 . PHP_EOL; $t0 = microtime(true); for ($i = 0; $i < $limit; ++$i) { $j = $i & 1; } echo microtime(true) - $t0 . PHP_EOL; $t0 = microtime(true); for ($i = 0; $i < $limit; ++$i) { $j = (bool) $i & 10; } echo microtime(true) - $t0 . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 7
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 25
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 42
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 42
Branch analysis from position: 48
Branch analysis from position: 42
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 25
Branch analysis from position: 30
Branch analysis from position: 25
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 7
Branch analysis from position: 13
Branch analysis from position: 7
filename:       /in/r4rA4
function name:  (null)
number of ops:  55
compiled vars:  !0 = $limit, !1 = $t0, !2 = $i, !3 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 100000
    4     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    5     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->11
    6     7    >   MOD                                              ~8      !2, 10
          8        IS_IDENTICAL                                     ~9      ~8, 0
          9        ASSIGN                                                   !3, ~9
    5    10        PRE_INC                                                  !2
         11    >   IS_SMALLER                                               !2, !0
         12      > JMPNZ                                                    ~12, ->7
    8    13    >   INIT_FCALL                                               'microtime'
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $13     
         16        SUB                                              ~14     $13, !1
         17        CONCAT                                           ~15     ~14, '%0A'
         18        ECHO                                                     ~15
    9    19        INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $16     
         22        ASSIGN                                                   !1, $16
   10    23        ASSIGN                                                   !2, 0
         24      > JMP                                                      ->28
   11    25    >   BW_AND                                           ~19     !2, 1
         26        ASSIGN                                                   !3, ~19
   10    27        PRE_INC                                                  !2
         28    >   IS_SMALLER                                               !2, !0
         29      > JMPNZ                                                    ~22, ->25
   13    30    >   INIT_FCALL                                               'microtime'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $23     
         33        SUB                                              ~24     $23, !1
         34        CONCAT                                           ~25     ~24, '%0A'
         35        ECHO                                                     ~25
   14    36        INIT_FCALL                                               'microtime'
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                         $26     
         39        ASSIGN                                                   !1, $26
   16    40        ASSIGN                                                   !2, 0
         41      > JMP                                                      ->46
   17    42    >   BOOL                                             ~29     !2
         43        BW_AND                                           ~30     ~29, 10
         44        ASSIGN                                                   !3, ~30
   16    45        PRE_INC                                                  !2
         46    >   IS_SMALLER                                               !2, !0
         47      > JMPNZ                                                    ~33, ->42
   19    48    >   INIT_FCALL                                               'microtime'
         49        SEND_VAL                                                 <true>
         50        DO_ICALL                                         $34     
         51        SUB                                              ~35     $34, !1
         52        CONCAT                                           ~36     ~35, '%0A'
         53        ECHO                                                     ~36
         54      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.34 ms | 1400 KiB | 15 Q