3v4l.org

run code in 300+ PHP versions simultaneously
<?php $facturation = [ 'start_time' => '27/06/2017', 'mtt' => '50000', 'periodicite' => '12' ]; var_dump(strtotime(str_replace('/','-', $facturation['start_time']))); die; // generate tasks depending on amount (/x days + rest in last // start_time and end_time accordingly $tasks_data = []; $current_start_time = date('Y-m-d', strtotime(str_replace('/', '-', $facturation['start_time']))); // calculate mtt per month approximately $mtt_per_period = floatval($facturation['mtt']) / floatval($facturation['periodicite']); $mtt_per_period = number_format((float)$mtt_per_period, 2, '.', ''); $delta_time = ($facturation['periodicite'] == '12') ? '1 month' : '1 year'; for ($i=0; $i < $facturation['periodicite'] ; $i++) { $current_end_time = date('d/m/Y', strtotime($current_start_time . ' +' . $delta_time)); $budget = $mtt_per_period; if ($i === intval($facturation['periodicite'])-1) { $budget = floatval($facturation['mtt']) - ((floatval($facturation['periodicite'])-1) * $mtt_per_period); $budget = number_format((float)$budget, 2, '.', ''); } $tasks_data[] = [ 'start_time' => $current_start_time, 'end_time' => $current_end_time, 'title' => ($facturation['periodicite'] == '12') ? 'acompte ' . '' . explode('/', $current_start_time)[2] : 'échéance unique', 'budget' => $budget ]; $current_start_time = date('d/m/Y', strtotime($current_start_time . ' +' . $delta_time)); } var_dump($tasks_data);

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.3.70.0150.00418.18
8.3.60.0140.00718.68
8.3.50.0150.00316.59
8.3.40.0090.00618.88
8.3.30.0090.00619.10
8.3.20.0070.00021.72
8.3.10.0040.00423.65
8.3.00.0080.00018.03
8.2.190.0090.00616.63
8.2.180.0110.00418.66
8.2.170.0120.00322.96
8.2.160.0070.00721.04
8.2.150.0060.00324.18
8.2.140.0050.00224.66
8.2.130.0040.00420.52
8.2.120.0040.00426.35
8.2.110.0060.00321.11
8.2.100.0070.00418.21
8.2.90.0040.00419.35
8.2.80.0040.00418.05
8.2.70.0060.00317.88
8.2.60.0040.00418.00
8.2.50.0000.00818.10
8.2.40.0030.00620.47
8.2.30.0030.00619.36
8.2.20.0050.00318.23
8.2.10.0050.00318.21
8.2.00.0020.00518.02
8.1.280.0070.01125.92
8.1.270.0000.00723.84
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0040.00423.96
8.1.230.0080.00319.11
8.1.220.0000.00817.78
8.1.210.0040.00418.77
8.1.200.0080.00417.38
8.1.190.0090.00017.35
8.1.180.0040.00418.10
8.1.170.0000.00818.64
8.1.160.0040.00418.88
8.1.150.0050.00220.02
8.1.140.0000.00719.61
8.1.130.0030.00318.92
8.1.120.0040.00417.64
8.1.110.0030.00617.56
8.1.100.0050.00317.51
8.1.90.0040.00417.45
8.1.80.0000.00717.66
8.1.70.0070.00017.60
8.1.60.0040.00417.64
8.1.50.0050.00317.67
8.1.40.0050.00317.67
8.1.30.0000.00817.77
8.1.20.0050.00217.80
8.1.10.0000.00817.72
8.1.00.0000.00817.62
8.0.300.0090.00018.77
8.0.290.0000.00716.75
8.0.280.0070.00018.48
8.0.270.0030.00617.29
8.0.260.0030.00316.91
8.0.250.0000.00817.08
8.0.240.0060.00317.21
8.0.230.0050.00517.18
8.0.220.0000.00717.09
8.0.210.0030.00317.18
8.0.200.0000.00617.17
8.0.190.0080.00017.13
8.0.180.0030.00517.02
8.0.170.0000.00717.02
8.0.160.0000.00717.09
8.0.150.0030.00616.95
8.0.140.0070.00017.10
8.0.130.0040.00413.44
8.0.120.0030.00616.95
8.0.110.0000.00817.17
8.0.100.0000.00817.07
8.0.90.0000.00717.18
8.0.80.0030.01317.07
8.0.70.0050.00317.04
8.0.60.0000.00816.99
8.0.50.0070.00017.13
8.0.30.0100.00817.37
8.0.20.0140.00817.44
8.0.10.0080.00017.18
8.0.00.0050.01416.88
7.4.330.0020.00215.55
7.4.320.0000.00616.61
7.4.300.0030.00316.70
7.4.290.0000.00716.59
7.4.280.0080.00316.67
7.4.270.0070.00016.67
7.4.260.0060.00013.36
7.4.250.0030.00516.52
7.4.240.0000.00716.66
7.4.230.0000.00716.68
7.4.220.0090.00916.81
7.4.210.0130.00816.64
7.4.200.0050.00216.50
7.4.160.0110.00816.64
7.4.150.0140.00317.40
7.4.140.0100.00917.86
7.4.130.0120.00816.63
7.4.120.0130.01016.69
7.4.110.0100.00716.59
7.4.100.0140.01016.67
7.4.90.0080.01316.54
7.4.80.0120.00419.39
7.4.70.0130.01016.60
7.4.60.0130.00316.75
7.4.50.0030.01316.66
7.4.40.0100.00716.73
7.4.30.0040.01216.47
7.4.00.0060.01015.29
7.3.330.0030.00313.21
7.3.320.0050.00013.16
7.3.310.0040.00416.39
7.3.300.0030.00316.32
7.3.290.0100.00816.47
7.3.280.0100.00716.42
7.3.270.0140.00317.40
7.3.260.0080.00916.49
7.3.250.0100.01116.61
7.3.240.0110.00716.58
7.3.230.0130.00316.50
7.3.210.0060.00916.34
7.3.200.0100.00716.76
7.3.190.0090.00616.41
7.3.180.0100.00616.82
7.3.170.0120.00916.44
7.3.160.0090.00616.45
7.2.330.0100.00716.70
7.2.320.0200.00416.88
7.2.310.0170.00016.80
7.2.300.0070.01016.88
7.2.290.0080.00816.88
7.2.60.0040.00417.03
7.1.200.0030.00715.79
7.1.70.0000.00717.34
7.1.60.0530.01033.39
7.1.50.0370.01733.25
7.1.40.0730.01032.48
7.1.30.0670.02332.68
7.1.20.0470.01032.63
7.1.10.0370.01014.96
7.1.00.0400.00715.03
7.0.200.0330.01015.01
7.0.190.0400.00714.94
7.0.180.0430.01314.52
7.0.170.0600.00714.57
7.0.160.0670.00714.48
7.0.150.0570.01314.51
7.0.140.0370.01314.79
7.0.130.0370.00714.88
7.0.120.0570.00314.75
7.0.110.0470.01714.59
7.0.100.0500.01014.71
7.0.90.0630.00014.70
7.0.80.0330.01314.55
7.0.70.0400.00714.73
7.0.60.0330.01014.27
7.0.50.0370.01014.83
7.0.40.0370.01314.75
7.0.30.0430.00714.66
7.0.20.0900.00714.88
7.0.10.0370.00714.69
7.0.00.0330.01014.77

preferences:
27.43 ms | 401 KiB | 5 Q