3v4l.org

run code in 300+ PHP versions simultaneously
<?php $initialCredit = 40000; $monthlyPayment = 5000; $creditInterestPercent = 3; $commission = 1000; $remainingCredit = $initialCredit; $paid = 0; $monthCount = 0; $creditInterest = $remainingCredit / 100 * $creditInterestPercent; $creditIncrease = $creditInterest + $commission; if ($creditIncrease >= $monthlyPayment) { echo 'Кредит выплатить невозможно. Обслуживание выше ежемесячной платы.'; return; } while ($remainingCredit > 0) { $creditInterest = $remainingCredit / 100 * $creditInterestPercent; $creditIncrease = $creditInterest + $commission; $remainingCredit += $creditIncrease; $payment = min($remainingCredit, $monthlyPayment); $remainingCredit -= $payment; $paid += $payment; $monthCount++; } echo 'Время выплаты: ' . $monthCount . ' месяцев, сумма выплаты: ' . ceil($paid);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.120.0080.01120.82
8.4.110.0070.00522.54
8.4.100.0090.01317.59
8.4.90.0130.00418.65
8.4.80.0060.00317.93
8.4.70.0040.00519.61
8.4.60.0120.00919.36
8.4.50.0120.01019.37
8.4.40.0040.01817.57
8.4.30.0070.01318.91
8.4.20.0130.00718.04
8.4.10.0040.00419.48
8.3.250.0100.00819.02
8.3.240.0090.01016.83
8.3.230.0080.00916.54
8.3.220.0100.00817.33
8.3.210.0110.00516.56
8.3.200.0110.00916.88
8.3.190.0100.00916.47
8.3.180.0060.00319.10
8.3.170.0150.00318.93
8.3.160.0120.00618.50
8.3.150.0120.00618.98
8.3.140.0050.00319.02
8.3.130.0030.00618.30
8.3.120.0090.00019.18
8.3.110.0080.00020.94
8.3.100.0000.01016.55
8.3.90.0000.00826.77
8.3.80.0030.00618.55
8.3.70.0130.00618.43
8.3.60.0030.01218.43
8.3.50.0110.00716.56
8.3.40.0100.01021.90
8.3.30.0130.00319.21
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.290.0080.01120.34
8.2.280.0060.00418.54
8.2.270.0090.00917.57
8.2.260.0000.00718.73
8.2.250.0000.00816.62
8.2.240.0080.00817.32
8.2.230.0040.00422.58
8.2.220.0070.00324.06
8.2.210.0070.00026.77
8.2.200.0060.00318.04
8.2.190.0000.01518.41
8.2.180.0120.00316.50
8.2.170.0070.00718.94
8.2.160.0030.01022.96
8.2.150.0070.00025.66
8.2.140.0080.00824.66
8.2.130.0070.00026.16
8.2.120.0110.00419.89
8.2.110.0120.00922.42
8.2.100.0120.00920.75
8.2.90.0150.00620.68
8.2.80.0040.00820.50
8.2.70.0100.00020.66
8.2.60.0030.02020.41
8.2.50.0180.00318.89
8.2.40.0150.00618.95
8.2.30.0140.00318.83
8.2.20.0160.00618.87
8.2.10.0140.00718.82
8.2.00.0100.01318.79
8.1.330.0170.00522.10
8.1.320.0120.00716.06
8.1.310.0130.00618.47
8.1.300.0040.00418.59
8.1.290.0030.00630.84
8.1.280.0120.00325.92
8.1.270.0080.00024.66
8.1.260.0030.00626.35
8.1.250.0080.00028.09
8.1.240.0150.00718.74
8.1.230.0130.01018.70
8.1.220.0140.00718.60
8.1.210.0110.00720.02
8.1.200.0100.00018.61
8.1.190.0060.01318.41
8.1.180.0090.01518.43
8.1.170.0070.00418.63
8.1.160.0130.01018.86
8.1.150.0000.01118.80
8.1.140.0060.00618.65
8.1.130.0130.01018.52
8.1.120.0120.00618.50
8.1.110.0030.01418.52
8.1.100.0120.00618.61
8.1.90.0100.00618.63
8.1.80.0140.00418.65
8.1.70.0070.01018.83
8.1.60.0000.01118.75
8.1.50.0140.00418.71
8.1.40.0060.00319.01
8.1.30.0110.00318.82
8.1.20.0070.00318.86
8.1.10.0100.00018.79
8.1.00.0060.00318.73
8.0.300.0080.00417.96
8.0.290.0030.00718.00
8.0.280.0070.00717.73
8.0.270.0060.00317.81
8.0.260.0070.00317.87
8.0.250.0060.00318.01
8.0.240.0030.00618.01
8.0.230.0060.00318.09
8.0.220.0050.00517.80
8.0.210.0070.01018.00
8.0.200.0060.00317.97
8.0.190.0060.00317.96
8.0.180.0040.01117.77
8.0.170.0090.00018.02
8.0.160.0030.00718.01
8.0.150.0090.00017.89
8.0.140.0130.00717.87
8.0.130.0100.01017.86
8.0.120.0130.00717.96
8.0.110.0090.00618.13
8.0.100.0060.00317.92
8.0.90.0180.00417.81
8.0.80.0030.00617.83
8.0.70.0060.00317.88
8.0.60.0040.00417.83
8.0.50.0060.00317.96
8.0.30.0100.00018.02
8.0.20.0030.00618.04
8.0.10.0080.00317.93

preferences:
27.46 ms | 403 KiB | 5 Q