fork(1) download
  1. <?php
  2.  
  3.  
  4. function getMoneyFuture($percent, $year, $deposit) {
  5. for ($i=0; $i < $year; $i++){
  6. $deposit = $deposit * $persent;
  7. }
  8. return $deposit;
  9. }
  10. $balance = getMoneyFuture(2, 5, 10000);
  11. echo "Через 5 лет у нас будет {$balance}";
Success #stdin #stdout #stderr 0.02s 24400KB
stdin
Standard input is empty
stdout
Через 5 лет у нас будет 0
stderr
PHP Notice:  Undefined variable: persent in /home/OZq1Nv/prog.php on line 7
PHP Notice:  Undefined variable: persent in /home/OZq1Nv/prog.php on line 7
PHP Notice:  Undefined variable: persent in /home/OZq1Nv/prog.php on line 7
PHP Notice:  Undefined variable: persent in /home/OZq1Nv/prog.php on line 7
PHP Notice:  Undefined variable: persent in /home/OZq1Nv/prog.php on line 7