3v4l.org

run code in 300+ PHP versions simultaneously
<?php function calc($n, &$a) { $b = 18; while($n) { $a = $b * $b * $b * $b; $n--; } } $n = 5000000; $a = 0; $start = microtime(true); calc($n, $a); $end = microtime(true); echo "$a\n"; printf("%.6f seconds\n", $end - $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BKltl
function name:  (null)
number of ops:  23
compiled vars:  !0 = $n, !1 = $a, !2 = $start, !3 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, 5000000
   12     1        ASSIGN                                                   !1, 0
   14     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !2, $6
   15     6        INIT_FCALL                                               'calc'
          7        SEND_VAR                                                 !0
          8        SEND_REF                                                 !1
          9        DO_FCALL                                      0          
   16    10        INIT_FCALL                                               'microtime'
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !3, $9
   17    14        NOP                                                      
         15        FAST_CONCAT                                      ~11     !1, '%0A'
         16        ECHO                                                     ~11
   18    17        INIT_FCALL                                               'printf'
         18        SEND_VAL                                                 '%25.6f+seconds%0A'
         19        SUB                                              ~12     !3, !2
         20        SEND_VAL                                                 ~12
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Function calc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 4
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 4
Branch analysis from position: 10
Branch analysis from position: 4
filename:       /in/BKltl
function name:  calc
number of ops:  11
compiled vars:  !0 = $n, !1 = $a, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, 18
    5     3      > JMP                                                      ->9
    6     4    >   MUL                                              ~4      !2, !2
          5        MUL                                              ~5      !2, ~4
          6        MUL                                              ~6      !2, ~5
          7        ASSIGN                                                   !1, ~6
    7     8        PRE_DEC                                                  !0
    5     9    > > JMPNZ                                                    !0, ->4
    9    10    > > RETURN                                                   null

End of function calc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.11 ms | 1403 KiB | 18 Q