3v4l.org

run code in 300+ PHP versions simultaneously
<?php bcscale(100); for ($n = 0; $n < 100; $n++) { $a = ((2.0**(1.0/12.0))**$n) * 440.0; $b = ((2.0**($n/12.0))) * 440.0; $c = $a - $b; echo "$c\n"; } for ($n = 0; $n < 100; $n++) { $a = bcmul(bcpow(bcpow('2.0', bcdiv('1.0', '12.0')), "$n"), '440.0'); $b = bcmul(bcpow('2.0', bcdiv("$n", '12.0')), '440.0'); $c = bcsub($a, $b); echo "$c\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 5
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 22
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 22
Branch analysis from position: 65
Branch analysis from position: 22
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 5
Branch analysis from position: 20
Branch analysis from position: 5
filename:       /in/t6qjA
function name:  (null)
number of ops:  66
compiled vars:  !0 = $n, !1 = $a, !2 = $b, !3 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'bcscale'
          1        SEND_VAL_EX                                              100
          2        DO_FCALL                                      0          
    3     3        ASSIGN                                                   !0, 0
          4      > JMP                                                      ->18
    5     5    >   POW                                              ~6      1.05946, !0
          6        MUL                                              ~7      ~6, 440
          7        ASSIGN                                                   !1, ~7
    6     8        DIV                                              ~9      !0, 12
          9        POW                                              ~10     2, ~9
         10        MUL                                              ~11     ~10, 440
         11        ASSIGN                                                   !2, ~11
    7    12        SUB                                              ~13     !1, !2
         13        ASSIGN                                                   !3, ~13
    8    14        NOP                                                      
         15        FAST_CONCAT                                      ~15     !3, '%0A'
         16        ECHO                                                     ~15
    3    17        PRE_INC                                                  !0
         18    >   IS_SMALLER                                               !0, 100
         19      > JMPNZ                                                    ~17, ->5
   10    20    >   ASSIGN                                                   !0, 0
         21      > JMP                                                      ->63
   12    22    >   INIT_FCALL_BY_NAME                                       'bcmul'
         23        INIT_FCALL_BY_NAME                                       'bcpow'
         24        INIT_FCALL_BY_NAME                                       'bcpow'
         25        SEND_VAL_EX                                              '2.0'
         26        INIT_FCALL_BY_NAME                                       'bcdiv'
         27        SEND_VAL_EX                                              '1.0'
         28        SEND_VAL_EX                                              '12.0'
         29        DO_FCALL                                      0  $19     
         30        SEND_VAR_NO_REF_EX                                       $19
         31        DO_FCALL                                      0  $20     
         32        SEND_VAR_NO_REF_EX                                       $20
         33        CAST                                          6  ~21     !0
         34        SEND_VAL_EX                                              ~21
         35        DO_FCALL                                      0  $22     
         36        SEND_VAR_NO_REF_EX                                       $22
         37        SEND_VAL_EX                                              '440.0'
         38        DO_FCALL                                      0  $23     
         39        ASSIGN                                                   !1, $23
   13    40        INIT_FCALL_BY_NAME                                       'bcmul'
         41        INIT_FCALL_BY_NAME                                       'bcpow'
         42        SEND_VAL_EX                                              '2.0'
         43        INIT_FCALL_BY_NAME                                       'bcdiv'
         44        CAST                                          6  ~25     !0
         45        SEND_VAL_EX                                              ~25
         46        SEND_VAL_EX                                              '12.0'
         47        DO_FCALL                                      0  $26     
         48        SEND_VAR_NO_REF_EX                                       $26
         49        DO_FCALL                                      0  $27     
         50        SEND_VAR_NO_REF_EX                                       $27
         51        SEND_VAL_EX                                              '440.0'
         52        DO_FCALL                                      0  $28     
         53        ASSIGN                                                   !2, $28
   14    54        INIT_FCALL_BY_NAME                                       'bcsub'
         55        SEND_VAR_EX                                              !1
         56        SEND_VAR_EX                                              !2
         57        DO_FCALL                                      0  $30     
         58        ASSIGN                                                   !3, $30
   15    59        NOP                                                      
         60        FAST_CONCAT                                      ~32     !3, '%0A'
         61        ECHO                                                     ~32
   10    62        PRE_INC                                                  !0
         63    >   IS_SMALLER                                               !0, 100
         64      > JMPNZ                                                    ~34, ->22
   16    65    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.13 ms | 1004 KiB | 13 Q