3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1() { $s = microtime(true); $a = 15484; for ($i = 0; $i < 1000000; $i++) { $b = $a / 2; } return microtime(true) - $s; } function test2() { $s = microtime(true); $a = 15484; for ($i = 0; $i < 1000000; $i++) { $b = $a >> 1; } return microtime(true) - $s; } echo test1()."\n"; echo test2()."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kugao
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   INIT_FCALL                                               'test1'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      $0, '%0A'
          3        ECHO                                                     ~1
   30     4        INIT_FCALL                                               'test2'
          5        DO_FCALL                                      0  $2      
          6        CONCAT                                           ~3      $2, '%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/Kugao
function name:  test1
number of ops:  18
compiled vars:  !0 = $s, !1 = $a, !2 = $i, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    7     4        ASSIGN                                                   !1, 15484
    9     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->10
   10     7    >   DIV                                              ~8      !1, 2
          8        ASSIGN                                                   !3, ~8
    9     9        PRE_INC                                                  !2
         10    >   IS_SMALLER                                               !2, 1000000
         11      > JMPNZ                                                    ~11, ->7
   13    12    >   INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $12     
         15        SUB                                              ~13     $12, !0
         16      > RETURN                                                   ~13
   14    17*     > RETURN                                                   null

End of function test1

Function test2:
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/Kugao
function name:  test2
number of ops:  18
compiled vars:  !0 = $s, !1 = $a, !2 = $i, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
   20     4        ASSIGN                                                   !1, 15484
   22     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->10
   23     7    >   SR                                               ~8      !1, 1
          8        ASSIGN                                                   !3, ~8
   22     9        PRE_INC                                                  !2
         10    >   IS_SMALLER                                               !2, 1000000
         11      > JMPNZ                                                    ~11, ->7
   26    12    >   INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $12     
         15        SUB                                              ~13     $12, !0
         16      > RETURN                                                   ~13
   27    17*     > RETURN                                                   null

End of function test2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.23 ms | 1392 KiB | 19 Q