3v4l.org

run code in 500+ 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);

preferences:
51.99 ms | 1252 KiB | 5 Q