3v4l.org

run code in 300+ PHP versions simultaneously
<?php $facturation = [ 'start_time' => '27/06/2017', 'mtt' => '50000', 'periodicite' => '12' ]; var_dump(date('Y-m-d H:i:s', 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.60.0110.00718.40
8.3.50.0030.01016.33
8.3.40.0110.00418.93
8.3.30.0120.00318.89
8.3.20.0070.00021.94
8.3.10.0080.00023.71
8.3.00.0040.00418.03
8.2.180.0130.00618.79
8.2.170.0120.00322.96
8.2.160.0090.00421.05
8.2.150.0030.00624.18
8.2.140.0080.00024.66
8.2.130.0000.00820.52
8.2.120.0000.00726.35
8.2.110.0090.00319.31
8.2.100.0090.00318.22
8.2.90.0000.00819.21
8.2.80.0000.00818.16
8.2.70.0040.00417.88
8.2.60.0000.00818.05
8.2.50.0080.00018.10
8.2.40.0060.00322.50
8.2.30.0000.00821.02
8.2.20.0000.00718.04
8.2.10.0040.00418.28
8.2.00.0070.00018.16
8.1.280.0070.01425.92
8.1.270.0040.00423.84
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0030.00623.98
8.1.230.0040.00819.10
8.1.220.0000.00817.79
8.1.210.0000.00818.77
8.1.200.0100.00017.35
8.1.190.0060.00317.48
8.1.180.0030.00618.10
8.1.170.0000.00818.74
8.1.160.0040.00418.94
8.1.150.0030.00521.76
8.1.140.0070.00019.72
8.1.130.0000.00718.86
8.1.120.0020.00517.60
8.1.110.0030.00517.62
8.1.100.0030.00517.58
8.1.90.0050.00317.54
8.1.80.0040.00417.66
8.1.70.0030.00317.62
8.1.60.0040.00417.72
8.1.50.0040.00417.60
8.1.40.0000.00717.59
8.1.30.0080.00017.88
8.1.20.0050.00217.86
8.1.10.0050.00317.77
8.1.00.0040.00417.79
8.0.300.0060.00318.77
8.0.290.0000.00717.00
8.0.280.0000.00718.50
8.0.270.0040.00417.30
8.0.260.0000.00717.01
8.0.250.0030.00317.17
8.0.240.0040.00417.18
8.0.230.0000.01017.10
8.0.220.0030.00317.03
8.0.210.0030.00317.15
8.0.200.0000.00717.13
8.0.190.0060.00317.22
8.0.180.0060.00317.05
8.0.170.0050.00317.05
8.0.160.0000.00717.15
8.0.150.0030.00517.05
8.0.140.0070.00017.13
8.0.130.0060.00013.45
8.0.120.0000.00817.07
8.0.110.0050.00317.18
8.0.100.0000.00717.13
8.0.90.0050.00217.04
8.0.80.0030.01317.20
8.0.70.0080.00017.00
8.0.60.0000.00716.94
8.0.50.0050.00317.20
8.0.30.0070.01017.31
8.0.20.0100.00917.40
8.0.10.0040.00417.30
8.0.00.0200.00016.92
7.4.330.0000.00515.55
7.4.320.0040.00416.71
7.4.300.0030.00316.52
7.4.290.0080.00016.71
7.4.280.0040.00416.72
7.4.270.0030.00316.64
7.4.260.0030.00313.29
7.4.250.0000.00716.60
7.4.240.0000.00716.58
7.4.230.0000.00716.75
7.4.220.0060.01916.75
7.4.210.0150.00016.68
7.4.200.0000.00716.63
7.4.160.0120.00816.75
7.4.150.0030.01517.40
7.4.140.0130.00617.86
7.4.130.0130.00716.85
7.4.120.0130.01216.71
7.4.110.0170.00016.96
7.4.100.0110.01316.62
7.4.90.0070.01116.73
7.4.80.0070.01119.39
7.4.70.0060.01716.78
7.4.60.0100.00616.88
7.4.50.0090.00516.36
7.4.40.0080.00816.84
7.4.30.0060.01216.78
7.4.00.0050.01315.36
7.3.330.0050.00013.35
7.3.320.0020.00213.25
7.3.310.0030.00616.48
7.3.300.0060.00016.44
7.3.290.0070.01016.41
7.3.280.0070.01016.43
7.3.270.0090.00917.40
7.3.260.0080.00816.51
7.3.250.0090.01116.64
7.3.240.0160.00516.56
7.3.230.0070.01016.58
7.3.210.0070.01016.52
7.3.200.0080.01216.51
7.3.190.0100.00716.59
7.3.180.0070.01016.43
7.3.170.0040.01116.48
7.3.160.0130.01016.61
7.3.120.0100.01014.91
7.3.110.0090.00915.00
7.3.100.0090.00615.09
7.3.90.0000.01215.05
7.3.80.0040.01115.03
7.3.70.0070.00315.06
7.3.60.0070.00714.90
7.3.50.0090.00614.98
7.3.40.0000.01115.00
7.3.30.0040.01114.78
7.3.20.0040.01516.53
7.3.10.0100.01016.69
7.3.00.0060.01316.85
7.2.330.0080.00816.80
7.2.320.0110.00816.46
7.2.310.0130.01016.45
7.2.300.0040.01316.55
7.2.290.0150.00416.86
7.2.250.0060.01014.95
7.2.240.0070.01315.44
7.2.230.0040.01415.08
7.2.220.0070.01015.21
7.2.210.0090.00615.11
7.2.200.0120.00315.30
7.2.190.0080.00814.77
7.2.180.0030.00614.85
7.2.170.0040.00815.21
7.2.60.0130.00616.79
7.2.00.0000.01219.74
7.1.330.0070.00715.75
7.1.320.0120.00315.75
7.1.310.0100.00615.74
7.1.300.0040.01115.92
7.1.290.0110.00415.64
7.1.280.0070.01115.59
7.1.270.0100.00715.99
7.1.260.0060.01015.81
7.1.200.0040.00715.81
7.1.100.0070.01018.34
7.1.70.0050.00317.23
7.1.60.0200.01033.49
7.1.50.0870.00033.19
7.1.40.0300.01032.48
7.1.30.0970.01332.54
7.1.20.0230.01332.80
7.1.10.1000.01014.84
7.1.00.1030.01014.86
7.0.200.1130.00714.97
7.0.190.0030.01015.12
7.0.180.0370.01014.48
7.0.170.0070.01014.59
7.0.160.0100.01014.34
7.0.150.0600.00714.53
7.0.140.0270.01014.74
7.0.130.0100.01014.80
7.0.120.1130.01014.79
7.0.110.0270.01314.63
7.0.100.0930.01014.54
7.0.90.0900.01314.71
7.0.80.0030.01314.56
7.0.70.0270.01714.61
7.0.60.0870.01714.48
7.0.50.0400.01714.56
7.0.40.0200.00314.70
7.0.30.0070.01014.82
7.0.20.0930.00314.63
7.0.10.0800.01314.93
7.0.00.0030.01714.78

preferences:
56.45 ms | 401 KiB | 5 Q