3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $hoge = 1; $rate = 0.4; $logs = []; foreach (range(1, 30) as $count) { $hoge *= $rate; $logs[$count] = $hoge; } var_dump($logs);
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
array(30) { [1]=> float(0.4) [2]=> float(0.16) [3]=> float(0.064) [4]=> float(0.0256) [5]=> float(0.01024) [6]=> float(0.004096) [7]=> float(0.0016384) [8]=> float(0.00065536) [9]=> float(0.000262144) [10]=> float(0.0001048576) [11]=> float(4.194304E-5) [12]=> float(1.6777216E-5) [13]=> float(6.7108864E-6) [14]=> float(2.68435456E-6) [15]=> float(1.073741824E-6) [16]=> float(4.294967296E-7) [17]=> float(1.7179869184E-7) [18]=> float(6.8719476736E-8) [19]=> float(2.74877906944E-8) [20]=> float(1.099511627776E-8) [21]=> float(4.398046511104E-9) [22]=> float(1.7592186044416E-9) [23]=> float(7.0368744177664E-10) [24]=> float(2.8147497671066E-10) [25]=> float(1.1258999068426E-10) [26]=> float(4.5035996273705E-11) [27]=> float(1.8014398509482E-11) [28]=> float(7.2057594037928E-12) [29]=> float(2.8823037615171E-12) [30]=> float(1.1529215046068E-12) }