3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = 123.321; $y = 321.123; $start = microtime(true); for ($i = 0; $i < 100000; $i++) $b = hypot($x, $y); var_dump(microtime(true) - $start); var_dump($b); $start = microtime(true); for ($i = 0; $i < 100000; $i++) $b = sqrt($x * $x + $y * $y); var_dump(microtime(true) - $start); var_dump($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 8
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 32
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 32
Branch analysis from position: 42
Branch analysis from position: 32
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 8
Branch analysis from position: 16
Branch analysis from position: 8
filename:       /in/4gK3E
function name:  (null)
number of ops:  53
compiled vars:  !0 = $x, !1 = $y, !2 = $start, !3 = $i, !4 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 123.321
    4     1        ASSIGN                                                   !1, 321.123
    5     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !2, $7
    6     6        ASSIGN                                                   !3, 0
          7      > JMP                                                      ->14
    7     8    >   INIT_FCALL                                               'hypot'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !4, $10
    6    13        PRE_INC                                                  !3
         14    >   IS_SMALLER                                               !3, 100000
         15      > JMPNZ                                                    ~13, ->8
    8    16    >   INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $14     
         20        SUB                                              ~15     $14, !2
         21        SEND_VAL                                                 ~15
         22        DO_ICALL                                                 
    9    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !4
         25        DO_ICALL                                                 
   10    26        INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $18     
         29        ASSIGN                                                   !2, $18
   11    30        ASSIGN                                                   !3, 0
         31      > JMP                                                      ->40
   12    32    >   INIT_FCALL                                               'sqrt'
         33        MUL                                              ~21     !0, !0
         34        MUL                                              ~22     !1, !1
         35        ADD                                              ~23     ~21, ~22
         36        SEND_VAL                                                 ~23
         37        DO_ICALL                                         $24     
         38        ASSIGN                                                   !4, $24
   11    39        PRE_INC                                                  !3
         40    >   IS_SMALLER                                               !3, 100000
         41      > JMPNZ                                                    ~27, ->32
   13    42    >   INIT_FCALL                                               'var_dump'
         43        INIT_FCALL                                               'microtime'
         44        SEND_VAL                                                 <true>
         45        DO_ICALL                                         $28     
         46        SUB                                              ~29     $28, !2
         47        SEND_VAL                                                 ~29
         48        DO_ICALL                                                 
   14    49        INIT_FCALL                                               'var_dump'
         50        SEND_VAR                                                 !4
         51        DO_ICALL                                                 
         52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
131.42 ms | 1405 KiB | 21 Q