3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = ['01.01.18', '02.01.18', '03.01.18']; //Dates are getting from daterange datepicker and preparing dates using php and stored in array. foreach($dates as $date) { // fetching data from table where date is matching with "$date". $bookings = [ ['date' => '01.01.18', 'beds' => '2'], ['date' => '01.01.18', 'beds' => '3'], ['date' => '01.01.18', 'beds' => '5'], ['date' => '02.01.18', 'beds' => '7'], ['date' => '02.01.18', 'beds' => '6'], ['date' => '02.01.18', 'beds' => '5'], ['date' => '03.01.18', 'beds' => '2'], ['date' => '03.01.18', 'beds' => '5'], ]; } $arr = array(); foreach($bookings as $booking) { $date = $booking['date']; if(array_key_exists($date, $arr)) $arr[$date][] = $booking['beds']; else $arr[$date] = array($booking['beds']); } foreach($arr as $key => $value) { $count = count($value); $sum = array_sum($value); echo "on {$key} I have {$count} bookings and sum of beds is {$sum}\r\n"; }

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.0000.01416.75
8.3.50.0090.00916.24
8.3.40.0120.00418.71
8.3.30.0110.00418.68
8.3.20.0060.00320.34
8.3.10.0000.00823.66
8.3.00.0040.00421.73
8.2.180.0100.00718.54
8.2.170.0100.01018.70
8.2.160.0070.00722.96
8.2.150.0070.00024.18
8.2.140.0060.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00420.95
8.2.110.0070.00320.37
8.2.100.0040.00817.71
8.2.90.0000.00818.03
8.2.80.0000.00817.97
8.2.70.0050.00317.50
8.2.60.0000.00818.05
8.2.50.0040.00418.07
8.2.40.0060.00318.28
8.2.30.0030.00618.15
8.2.20.0070.00018.13
8.2.10.0050.00318.06
8.2.00.0050.00218.14
8.1.280.0140.00725.92
8.1.270.0060.00320.69
8.1.260.0080.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00620.76
8.1.230.0090.00322.82
8.1.220.0040.00417.76
8.1.210.0030.00618.77
8.1.200.0030.00617.47
8.1.190.0030.00617.22
8.1.180.0000.00818.10
8.1.170.0090.00318.48
8.1.160.0040.00418.85
8.1.150.0080.00020.22
8.1.140.0040.00419.00
8.1.130.0030.00320.81
8.1.120.0040.00417.53
8.1.110.0060.00317.38
8.1.100.0000.00717.39
8.1.90.0040.00417.51
8.1.80.0100.00017.49
8.1.70.0000.00717.45
8.1.60.0030.00617.62
8.1.50.0000.00817.57
8.1.40.0080.00017.53
8.1.30.0000.00817.57
8.1.20.0030.00517.51
8.1.10.0000.00717.67
8.1.00.0000.00817.60
8.0.300.0000.00920.03
8.0.290.0080.00016.75
8.0.280.0040.00420.15
8.0.270.0050.00317.33
8.0.260.0030.00318.46
8.0.250.0000.00716.99
8.0.240.0000.00716.93
8.0.230.0000.00716.96
8.0.220.0000.00716.91
8.0.210.0030.00316.85
8.0.200.0000.00716.82
8.0.190.0040.00416.86
8.0.180.0040.00416.85
8.0.170.0000.00716.84
8.0.160.0070.00016.97
8.0.150.0000.00716.82
8.0.140.0000.00716.84
8.0.130.0030.00313.32
8.0.120.0040.00416.88
8.0.110.0060.00316.73
8.0.100.0040.00416.79
8.0.90.0070.00016.91
8.0.80.0040.01116.98
8.0.70.0040.00416.95
8.0.60.0040.00416.86
8.0.50.0070.00016.82
8.0.30.0110.00817.06
8.0.20.0140.00717.42
8.0.10.0040.00417.08
8.0.00.0140.00416.71
7.4.330.0040.00015.55
7.4.320.0030.00316.62
7.4.300.0030.00316.68
7.4.290.0050.00316.52
7.4.280.0000.00716.62
7.4.270.0000.00716.63
7.4.260.0030.00316.50
7.4.250.0040.00416.50
7.4.240.0050.00316.44
7.4.230.0030.00316.71
7.4.220.0120.00616.71
7.4.210.0140.01016.70
7.4.200.0040.00416.53
7.4.160.0120.00516.68
7.4.150.0130.00317.40
7.4.140.0120.00817.86
7.4.130.0090.00916.65
7.4.120.0130.00816.50
7.4.110.0130.00316.45
7.4.100.0130.00316.59
7.4.90.0090.00916.41
7.4.80.0070.01119.39
7.4.70.0030.01516.52
7.4.60.0070.01016.64
7.4.50.0120.00316.51
7.4.40.0130.00316.53
7.4.30.0050.01116.36
7.4.00.0000.01215.01
7.3.330.0020.00213.20
7.3.320.0000.00513.19
7.3.310.0000.00716.21
7.3.300.0030.00316.39
7.3.290.0060.01116.39
7.3.280.0060.01016.41
7.3.270.0140.00317.40
7.3.260.0090.00816.41
7.3.250.0100.00816.45
7.3.240.0100.00816.42
7.3.230.0110.00616.39
7.3.210.0160.00316.29
7.3.200.0110.00816.59
7.3.190.0160.00016.29
7.3.180.0080.00816.34
7.3.170.0070.01416.70
7.3.160.0130.00316.50
7.3.120.0090.00914.68
7.3.110.0060.01314.94
7.3.100.0150.00314.90
7.3.90.0030.01014.88
7.3.80.0060.00915.07
7.3.70.0060.00615.03
7.3.60.0090.00614.64
7.3.50.0030.00614.87
7.3.40.0060.00614.90
7.3.30.0030.01214.93
7.3.20.0070.01416.39
7.3.10.0030.01716.68
7.3.00.0060.00616.90
7.2.330.0060.01316.57
7.2.320.0170.00716.52
7.2.310.0080.01216.68
7.2.300.0090.00816.57
7.2.290.0170.00016.83
7.2.250.0120.00614.95
7.2.240.0100.01015.31
7.2.230.0030.00715.19
7.2.220.0030.01215.07
7.2.210.0040.01515.25
7.2.200.0060.00915.26
7.2.190.0060.00914.91
7.2.180.0070.00315.20
7.2.170.0100.01014.93
7.2.60.0140.00316.98
7.2.50.0090.00616.96
7.1.330.0040.01115.80
7.1.320.0060.00616.09
7.1.310.0070.00315.74
7.1.300.0040.00415.80
7.1.290.0030.01015.77
7.1.280.0090.00615.59
7.1.270.0060.00915.68
7.1.260.0070.00715.83
7.1.200.0060.00915.80
7.1.120.0760.00716.89
7.1.110.0600.00316.15
7.1.100.0610.00916.21
7.1.90.0610.00016.52
7.1.80.0530.01016.11
7.1.70.0620.00715.44
7.1.60.0910.00733.35
7.1.50.0660.02033.16
7.1.40.0620.01032.68
7.1.30.1050.02332.79
7.1.20.1070.01032.79
7.1.10.0570.01014.86
7.1.00.0570.01014.94
7.0.250.0670.00015.32
7.0.240.0660.00615.86
7.0.230.0580.00715.71
7.0.220.0560.01015.97
7.0.210.0540.01315.00
7.0.200.0620.00715.05
7.0.190.0700.01014.95
7.0.180.0580.01014.54
7.0.170.1310.01014.42
7.0.160.0720.00714.56
7.0.150.0480.01414.41
7.0.140.0600.00614.61
7.0.130.0580.00914.79
7.0.120.0560.00714.68
7.0.110.0580.01014.55
7.0.100.0630.01314.46
7.0.90.0590.01314.51
7.0.80.0620.00614.61
7.0.70.0590.01014.57
7.0.60.0690.00714.27
7.0.50.0630.01314.80
7.0.40.0640.01014.68
7.0.30.0670.00714.59
7.0.20.0640.01014.59
7.0.10.1250.01014.41
7.0.00.0660.00614.56

preferences:
56.68 ms | 401 KiB | 5 Q