fork download
  1. <?php
  2.  
  3. $creditBalance = 40000;
  4. $creditPercent = 1.03;
  5. $creditComission = 1000;
  6. $monthlyPayment = 5000;
  7. $paymentTotal = 0;
  8. $extraPayment = "x"
  9.  
  10. for ($month=1; $month <= 20; $month++) {
  11. $creditBalance = ($creditBalance * $creditPercent) + $creditComission - $monthlyPayment;
  12. $paymentTotal = $paymentTotal + $monthlyPayment;
  13. echo "{$month} месяц спустя: долг = {$creditBalance} руб, выплачено всего {$paymentTotal} руб.\n";
  14.  
  15. if ($creditBalance < 5000) {
  16. $creditBalance = $paymentTotal - "x";
  17. echo "С меня хватит!\n";
  18. break;
  19. }
  20. }
  21. ?>
Runtime error #stdin #stdout #stderr 0.02s 24400KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected 'for' (T_FOR) in /home/pBFND4/prog.php on line 11