3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $midi = array(); $a = 440; for($x = 0; $x < 127; $x++) { $midi[$x] = ($a / 32) * (2 ^ (($x - 9) / 12)); } print_r($midi); ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => 27.5 [1] => 27.5 [2] => 27.5 [3] => 27.5 [4] => 27.5 [5] => 27.5 [6] => 27.5 [7] => 27.5 [8] => 27.5 [9] => 27.5 [10] => 27.5 [11] => 27.5 [12] => 27.5 [13] => 27.5 [14] => 27.5 [15] => 27.5 [16] => 27.5 [17] => 27.5 [18] => 27.5 [19] => 27.5 [20] => 27.5 [21] => 41.25 [22] => 41.25 [23] => 41.25 [24] => 41.25 [25] => 41.25 [26] => 41.25 [27] => 41.25 [28] => 41.25 [29] => 41.25 [30] => 41.25 [31] => 41.25 [32] => 41.25 [33] => 0 [34] => 0 [35] => 0 [36] => 0 [37] => 0 [38] => 0 [39] => 0 [40] => 0 [41] => 0 [42] => 0 [43] => 0 [44] => 0 [45] => 13.75 [46] => 13.75 [47] => 13.75 [48] => 13.75 [49] => 13.75 [50] => 13.75 [51] => 13.75 [52] => 13.75 [53] => 13.75 [54] => 13.75 [55] => 13.75 [56] => 13.75 [57] => 82.5 [58] => 82.5 [59] => 82.5 [60] => 82.5 [61] => 82.5 [62] => 82.5 [63] => 82.5 [64] => 82.5 [65] => 82.5 [66] => 82.5 [67] => 82.5 [68] => 82.5 [69] => 96.25 [70] => 96.25 [71] => 96.25 [72] => 96.25 [73] => 96.25 [74] => 96.25 [75] => 96.25 [76] => 96.25 [77] => 96.25 [78] => 96.25 [79] => 96.25 [80] => 96.25 [81] => 55 [82] => 55 [83] => 55 [84] => 55 [85] => 55 [86] => 55 [87] => 55 [88] => 55 [89] => 55 [90] => 55 [91] => 55 [92] => 55 [93] => 68.75 [94] => 68.75 [95] => 68.75 [96] => 68.75 [97] => 68.75 [98] => 68.75 [99] => 68.75 [100] => 68.75 [101] => 68.75 [102] => 68.75 [103] => 68.75 [104] => 68.75 [105] => 137.5 [106] => 137.5 [107] => 137.5 [108] => 137.5 [109] => 137.5 [110] => 137.5 [111] => 137.5 [112] => 137.5 [113] => 137.5 [114] => 137.5 [115] => 137.5 [116] => 137.5 [117] => 151.25 [118] => 151.25 [119] => 151.25 [120] => 151.25 [121] => 151.25 [122] => 151.25 [123] => 151.25 [124] => 151.25 [125] => 151.25 [126] => 151.25 )