3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = 129; $i = 1; $y = 1; $m = microtime(true); for ($i = 1; $i <= 1000; ++$i){ $y = 1 << ceil(log($x, 2)); echo (microtime(true) - $m), "\n\r"; } $y = 1; $m = microtime(true); for ($i = 1; $i <= 1000; ++$i){ while ($y < $x) { $y = $y <<1; } } echo microtime(true) - $m;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 9
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 34
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 35
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 34
Branch analysis from position: 42
Branch analysis from position: 34
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 35
Branch analysis from position: 39
Branch analysis from position: 35
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 9
Branch analysis from position: 27
Branch analysis from position: 9
filename:       /in/tYheK
function name:  (null)
number of ops:  48
compiled vars:  !0 = $x, !1 = $i, !2 = $y, !3 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 129
    3     1        ASSIGN                                                   !1, 1
    5     2        ASSIGN                                                   !2, 1
    6     3        INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !3, $7
    7     7        ASSIGN                                                   !1, 1
          8      > JMP                                                      ->25
    8     9    >   INIT_FCALL                                               'ceil'
         10        INIT_FCALL                                               'log'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 2
         13        DO_ICALL                                         $10     
         14        SEND_VAR                                                 $10
         15        DO_ICALL                                         $11     
         16        SL                                               ~12     1, $11
         17        ASSIGN                                                   !2, ~12
    9    18        INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $14     
         21        SUB                                              ~15     $14, !3
         22        ECHO                                                     ~15
         23        ECHO                                                     '%0A%0D'
    7    24        PRE_INC                                                  !1
         25    >   IS_SMALLER_OR_EQUAL                                      !1, 1000
         26      > JMPNZ                                                    ~17, ->9
   12    27    >   ASSIGN                                                   !2, 1
   13    28        INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $19     
         31        ASSIGN                                                   !3, $19
   14    32        ASSIGN                                                   !1, 1
         33      > JMP                                                      ->40
   15    34    > > JMP                                                      ->37
   16    35    >   SL                                               ~22     !2, 1
         36        ASSIGN                                                   !2, ~22
   15    37    >   IS_SMALLER                                               !2, !0
         38      > JMPNZ                                                    ~24, ->35
   14    39    >   PRE_INC                                                  !1
         40    >   IS_SMALLER_OR_EQUAL                                      !1, 1000
         41      > JMPNZ                                                    ~26, ->34
   19    42    >   INIT_FCALL                                               'microtime'
         43        SEND_VAL                                                 <true>
         44        DO_ICALL                                         $27     
         45        SUB                                              ~28     $27, !3
         46        ECHO                                                     ~28
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.68 ms | 1392 KiB | 19 Q