3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); for($i = 1; $j = 1, $i <= 10000000; $i++){ ($i == $j); } $end = microtime(true); echo 'Not ternary: ', $end - $start, PHP_EOL; $start = microtime(true); for($i = 1; $j = 1, $i <= 10000000; $i++){ ($i == $j ? true : false); } $end = microtime(true); echo 'Ternary: ', $end - $start, PHP_EOL; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 26
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 26
Branch analysis from position: 36
Branch analysis from position: 26
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 26
Branch analysis from position: 36
Branch analysis from position: 26
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
Branch analysis from position: 6
filename:       /in/lch9o
function name:  (null)
number of ops:  45
compiled vars:  !0 = $start, !1 = $i, !2 = $j, !3 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    4     4        ASSIGN                                                   !1, 1
          5      > JMP                                                      ->9
    5     6    >   IS_EQUAL                                         ~7      !1, !2
          7        FREE                                                     ~7
    4     8        PRE_INC                                                  !1
          9    >   ASSIGN                                                   !2, 1
         10        IS_SMALLER_OR_EQUAL                                      !1, 10000000
         11      > JMPNZ                                                    ~10, ->6
    8    12    >   INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !3, $11
   10    16        ECHO                                                     'Not+ternary%3A+'
         17        SUB                                              ~13     !3, !0
         18        ECHO                                                     ~13
         19        ECHO                                                     '%0A'
   12    20        INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $14     
         23        ASSIGN                                                   !0, $14
   14    24        ASSIGN                                                   !1, 1
         25      > JMP                                                      ->33
   15    26    >   IS_EQUAL                                                 !1, !2
         27      > JMPZ                                                     ~17, ->30
         28    >   QM_ASSIGN                                        ~18     <true>
         29      > JMP                                                      ->31
         30    >   QM_ASSIGN                                        ~18     <false>
         31    >   FREE                                                     ~18
   14    32        PRE_INC                                                  !1
         33    >   ASSIGN                                                   !2, 1
         34        IS_SMALLER_OR_EQUAL                                      !1, 10000000
         35      > JMPNZ                                                    ~21, ->26
   18    36    >   INIT_FCALL                                               'microtime'
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                         $22     
         39        ASSIGN                                                   !3, $22
   20    40        ECHO                                                     'Ternary%3A+'
         41        SUB                                              ~24     !3, !0
         42        ECHO                                                     ~24
         43        ECHO                                                     '%0A'
   21    44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.2 ms | 1400 KiB | 15 Q