3v4l.org

run code in 300+ PHP versions simultaneously
<?php $times = 1000*100*10; $var = true; $time1 = microtime(true); for ($i = 0; $i <= $times; $i++) { if ($var) {} } $time1 = microtime(true) - $time1; //echo "Time using '!': $time1\n"; $time2 = microtime(true); for ($i = 0; $i <= $times; $i++) { if ($var === true) {} } $time2 = microtime(true) - $time2; //echo "Time using '===': $time2\n"; if ($time1 > $time2){ $p = (($time1-$time2)/$time2) * 100; //printf("'===' was faster by %.2f percent.", $p); printf("'===' was faster"); } else { $p = (($time2-$time1)/$time1) * 100; //printf("' ' was faster by %.2f percent.", $p); printf("' ' was faster"); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 8
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 23
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 43
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 23
Branch analysis from position: 28
Branch analysis from position: 23
Branch analysis from position: 25
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 8
Branch analysis from position: 12
Branch analysis from position: 8
Branch analysis from position: 9
filename:       /in/pgKZS
function name:  (null)
number of ops:  51
compiled vars:  !0 = $times, !1 = $var, !2 = $time1, !3 = $i, !4 = $time2, !5 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1000000
    5     1        ASSIGN                                                   !1, <true>
    7     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !2, $8
    9     6        ASSIGN                                                   !3, 0
          7      > JMP                                                      ->10
   10     8    > > JMPZ                                                     !1, ->9
    9     9    >   PRE_INC                                                  !3
         10    >   IS_SMALLER_OR_EQUAL                                      !3, !0
         11      > JMPNZ                                                    ~12, ->8
   13    12    >   INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $13     
         15        SUB                                              ~14     $13, !2
         16        ASSIGN                                                   !2, ~14
   18    17        INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $16     
         20        ASSIGN                                                   !4, $16
   20    21        ASSIGN                                                   !3, 0
         22      > JMP                                                      ->26
   21    23    >   TYPE_CHECK                                    8          !1
         24      > JMPZ                                                     ~19, ->25
   20    25    >   PRE_INC                                                  !3
         26    >   IS_SMALLER_OR_EQUAL                                      !3, !0
         27      > JMPNZ                                                    ~21, ->23
   24    28    >   INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $22     
         31        SUB                                              ~23     $22, !4
         32        ASSIGN                                                   !4, ~23
   28    33        IS_SMALLER                                               !4, !2
         34      > JMPZ                                                     ~25, ->43
   29    35    >   SUB                                              ~26     !2, !4
         36        DIV                                              ~27     ~26, !4
         37        MUL                                              ~28     ~27, 100
         38        ASSIGN                                                   !5, ~28
   31    39        INIT_FCALL                                               'printf'
         40        SEND_VAL                                                 '%27%3D%3D%3D%27+was+faster'
         41        DO_ICALL                                                 
         42      > JMP                                                      ->50
   33    43    >   SUB                                              ~31     !4, !2
         44        DIV                                              ~32     ~31, !2
         45        MUL                                              ~33     ~32, 100
         46        ASSIGN                                                   !5, ~33
   35    47        INIT_FCALL                                               'printf'
         48        SEND_VAL                                                 '%27+%27+was+faster'
         49        DO_ICALL                                                 
   36    50    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.73 ms | 1392 KiB | 17 Q