3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.23 ms | 1392 KiB | 15 Q