<?php

error_reporting(-1);
 
$creditBalance = 40000;
$creditPercent = 1.03;
$servicePayment = 1000;
$payment = 5000;
$totalPayment = 0;

for ($month = 1; $month <= 24; $month++) {
	$creditBalance = ( $creditBalance * $creditPercent ) + $servicePayment - $payment;
	$totalPaymnet = $totalPayment + $payment;
	echo "{$month} ago his credit balance = {$creditBalance} and his total paymeint is {$totalPayment}\n";
	if ($creditBalance <= 0) {
		echo"It is time to stop, now";
		break;
	}
}