3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1() { $s = microtime(true); $var = null; for ($i = 0; $i < 1000000; $i++) { $condition = $var === null; } return microtime(true) - $s; } function test2() { $s = microtime(true); $var = null; for ($i = 0; $i < 1000000; $i++) { $condition = !isset($var); } return microtime(true) - $s; } echo test1() . "\n\n"; echo test2() . "\n\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vp6JK
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'test1'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      $0, '%0A%0A'
          3        ECHO                                                     ~1
   22     4        INIT_FCALL                                               'test2'
          5        DO_FCALL                                      0  $2      
          6        CONCAT                                           ~3      $2, '%0A%0A'
          7        ECHO                                                     ~3
          8      > RETURN                                                   1

Function test1:
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 = 7
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 7
Branch analysis from position: 12
Branch analysis from position: 7
filename:       /in/vp6JK
function name:  test1
number of ops:  18
compiled vars:  !0 = $s, !1 = $var, !2 = $i, !3 = $condition
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    5     4        ASSIGN                                                   !1, null
    6     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->10
    7     7    >   TYPE_CHECK                                    2  ~8      !1
          8        ASSIGN                                                   !3, ~8
    6     9        PRE_INC                                                  !2
         10    >   IS_SMALLER                                               !2, 1000000
         11      > JMPNZ                                                    ~11, ->7
    9    12    >   INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $12     
         15        SUB                                              ~13     $12, !0
         16      > RETURN                                                   ~13
   10    17*     > RETURN                                                   null

End of function test1

Function test2:
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 = 62) Position 1 = -2
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/vp6JK
function name:  test2
number of ops:  19
compiled vars:  !0 = $s, !1 = $var, !2 = $i, !3 = $condition
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
   14     4        ASSIGN                                                   !1, null
   15     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->11
   16     7    >   ISSET_ISEMPTY_CV                                 ~8      !1
          8        BOOL_NOT                                         ~9      ~8
          9        ASSIGN                                                   !3, ~9
   15    10        PRE_INC                                                  !2
         11    >   IS_SMALLER                                               !2, 1000000
         12      > JMPNZ                                                    ~12, ->7
   18    13    >   INIT_FCALL                                               'microtime'
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $13     
         16        SUB                                              ~14     $13, !0
         17      > RETURN                                                   ~14
   19    18*     > RETURN                                                   null

End of function test2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.41 ms | 1400 KiB | 19 Q