3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f() { $a = 1; for($i = 2; $i < 1000000; $i++) { $a += 1 / $i; } return $a; } $start = microtime(TRUE); f(); $end = microtime(TRUE); echo $end - $start, PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mkLa0
function name:  (null)
number of ops:  14
compiled vars:  !0 = $start, !1 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
   12     4        INIT_FCALL                                               'f'
          5        DO_FCALL                                      0          
   13     6        INIT_FCALL                                               'microtime'
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
   14    10        SUB                                              ~7      !1, !0
         11        ECHO                                                     ~7
         12        ECHO                                                     '%0A'
   15    13      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
Branch analysis from position: 3
filename:       /in/mkLa0
function name:  f
number of ops:  10
compiled vars:  !0 = $a, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 1
    5     1        ASSIGN                                                   !1, 2
          2      > JMP                                                      ->6
    6     3    >   DIV                                              ~4      1, !1
          4        ASSIGN_OP                                     1          !0, ~4
    5     5        PRE_INC                                                  !1
          6    >   IS_SMALLER                                               !1, 1000000
          7      > JMPNZ                                                    ~7, ->3
    8     8    > > RETURN                                                   !0
    9     9*     > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.65 ms | 1399 KiB | 16 Q