3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x=380; $xx=$x; $a=20; $q=10; $qq=0.012; $s=0; for ($i=$qq;; $i=$i+$i*$a*0.01) { $x-=$i; echo ($s+1).">>>". ($xx-$x)."\n##>>>(". $i.")\n"; if ($x <0) break; $y=$x; $s++; $c=$i; } echo "\n#######\n"; echo ($c)."///".$s."\\\\\\ \n".($xx-$x).">>>n>>".(-$x)."\nend>>>". ($y); ?>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
1>>>0.012 ##>>>(0.012) 2>>>0.026400000000024 ##>>>(0.0144) 3>>>0.043680000000052 ##>>>(0.01728) 4>>>0.064416000000051 ##>>>(0.020736) 5>>>0.089299200000028 ##>>>(0.0248832) 6>>>0.11915904 ##>>>(0.02985984) 7>>>0.15499084800001 ##>>>(0.035831808) 8>>>0.19798901760004 ##>>>(0.0429981696) 9>>>0.24958682112003 ##>>>(0.05159780352) 10>>>0.31150418534401 ##>>>(0.061917364224) 11>>>0.3858050224128 ##>>>(0.0743008370688) 12>>>0.47496602689534 ##>>>(0.08916100448256) 13>>>0.58195923227441 ##>>>(0.10699320537907) 14>>>0.71035107872927 ##>>>(0.12839184645489) 15>>>0.86442129447516 ##>>>(0.15407021574586) 16>>>1.0493055533702 ##>>>(0.18488425889504) 17>>>1.2711666640442 ##>>>(0.22186111067404) 18>>>1.5373999968531 ##>>>(0.26623333280885) 19>>>1.8568799962237 ##>>>(0.31947999937062) 20>>>2.2402559954684 ##>>>(0.38337599924475) 21>>>2.7003071945621 ##>>>(0.4600511990937) 22>>>3.2523686334746 ##>>>(0.55206143891244) 23>>>3.9148423601695 ##>>>(0.66247372669492) 24>>>4.7098108322035 ##>>>(0.79496847203391) 25>>>5.6637729986442 ##>>>(0.95396216644069) 26>>>6.808527598373 ##>>>(1.1447545997288) 27>>>8.1822331180476 ##>>>(1.3737055196746) 28>>>9.8306797416571 ##>>>(1.6484466236095) 29>>>11.808815689989 ##>>>(1.9781359483314) 30>>>14.182578827986 ##>>>(2.3737631379977) 31>>>17.031094593584 ##>>>(2.8485157655972) 32>>>20.4493135123 ##>>>(3.4182189187167) 33>>>24.55117621476 ##>>>(4.10186270246) 34>>>29.473411457712 ##>>>(4.922235242952) 35>>>35.380093749255 ##>>>(5.9066822915424) 36>>>42.468112499106 ##>>>(7.0880187498509) 37>>>50.973734998927 ##>>>(8.5056224998211) 38>>>61.180481998712 ##>>>(10.206746999785) 39>>>73.428578398454 ##>>>(12.248096399742) 40>>>88.126294078145 ##>>>(14.697715679691) 41>>>105.76355289377 ##>>>(17.637258815629) 42>>>126.92826347253 ##>>>(21.164710578755) 43>>>152.32591616704 ##>>>(25.397652694506) 44>>>182.80309940044 ##>>>(30.477183233407) 45>>>219.37571928053 ##>>>(36.572619880088) 46>>>263.26286313664 ##>>>(43.887143856106) 47>>>315.92743576396 ##>>>(52.664572627327) 48>>>379.12492291676 ##>>>(63.197487152793) 49>>>454.96190750011 ##>>>(75.836984583351) ####### 63.197487152793///48\\\ 454.96190750011>>>n>>74.961907500108 end>>>0.87507708324346
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 1>>>0.012 ##>>>(0.012) 2>>>0.026400000000024 ##>>>(0.0144) 3>>>0.043680000000052 ##>>>(0.01728) 4>>>0.064416000000051 ##>>>(0.020736) 5>>>0.089299200000028 ##>>>(0.0248832) 6>>>0.11915904 ##>>>(0.02985984) 7>>>0.15499084800001 ##>>>(0.035831808) 8>>>0.19798901760004 ##>>>(0.0429981696) 9>>>0.24958682112003 ##>>>(0.05159780352) 10>>>0.31150418534401 ##>>>(0.061917364224) 11>>>0.3858050224128 ##>>>(0.0743008370688) 12>>>0.47496602689534 ##>>>(0.08916100448256) 13>>>0.58195923227441 ##>>>(0.10699320537907) 14>>>0.71035107872927 ##>>>(0.12839184645489) 15>>>0.86442129447516 ##>>>(0.15407021574586) 16>>>1.0493055533702 ##>>>(0.18488425889504) 17>>>1.2711666640442 ##>>>(0.22186111067404) 18>>>1.5373999968531 ##>>>(0.26623333280885) 19>>>1.8568799962237 ##>>>(0.31947999937062) 20>>>2.2402559954684 ##>>>(0.38337599924475) 21>>>2.7003071945621 ##>>>(0.4600511990937) 22>>>3.2523686334746 ##>>>(0.55206143891244) 23>>>3.9148423601695 ##>>>(0.66247372669492) 24>>>4.7098108322035 ##>>>(0.79496847203391) 25>>>5.6637729986442 ##>>>(0.95396216644069) 26>>>6.808527598373 ##>>>(1.1447545997288) 27>>>8.1822331180476 ##>>>(1.3737055196746) 28>>>9.8306797416571 ##>>>(1.6484466236095) 29>>>11.808815689989 ##>>>(1.9781359483314) 30>>>14.182578827986 ##>>>(2.3737631379977) 31>>>17.031094593584 ##>>>(2.8485157655972) 32>>>20.4493135123 ##>>>(3.4182189187167) 33>>>24.55117621476 ##>>>(4.10186270246) 34>>>29.473411457712 ##>>>(4.922235242952) 35>>>35.380093749255 ##>>>(5.9066822915424) 36>>>42.468112499106 ##>>>(7.0880187498509) 37>>>50.973734998927 ##>>>(8.5056224998211) 38>>>61.180481998712 ##>>>(10.206746999785) 39>>>73.428578398454 ##>>>(12.248096399742) 40>>>88.126294078145 ##>>>(14.697715679691) 41>>>105.76355289377 ##>>>(17.637258815629) 42>>>126.92826347253 ##>>>(21.164710578755) 43>>>152.32591616704 ##>>>(25.397652694506) 44>>>182.80309940044 ##>>>(30.477183233407) 45>>>219.37571928053 ##>>>(36.572619880088) 46>>>263.26286313664 ##>>>(43.887143856106) 47>>>315.92743576396 ##>>>(52.664572627327) 48>>>379.12492291676 ##>>>(63.197487152793) 49>>>454.96190750011 ##>>>(75.836984583351) ####### 63.197487152793///48\\\ 454.96190750011>>>n>>74.961907500108 end>>>0.87507708324346

preferences:
157.72 ms | 409 KiB | 173 Q