3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.51 ms | 1400 KiB | 17 Q