3v4l.org

run code in 300+ PHP versions simultaneously
<?php $totalhousesleft = 1; $iteration = 0; for($x = 8000; $x > 0; $x = $x - 10){ if(empty($iteration)) { $iteration = $x/1000; } if ($totalhousesleft >= $x) { $currentprice = $iteration; $sellingprice = $currentprice + 1; break; } $iteration++; } if(empty($currentprice)){ $currentprice = $iteration; $sellingprice = $currentprice + 1; } var_dump($currentprice, $sellingprice);
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
int(808) int(809)

preferences:
129.92 ms | 402 KiB | 117 Q