3v4l.org

run code in 300+ PHP versions simultaneously
<?php $user_id = 42; $month = 2; $year = 2016; $startDate = new DateTimeImmutable( sprintf("%d-%d-01 00:00:00", $year, $month) ); $daysInMonth = new DatePeriod( $startDate, new DateInterval('P1D'), $startDate->modify('last day of this month') ); foreach($daysInMonth as $day){ $data = new StdClass(); $data->user_id= $user_id; $data->tp = 10; $data->days= $day->format('l'); $data->date= $day; $data->working_hours = 5; $monthlyHour[] = $data; } print_r($monthlyHour);

Abusive script

This script was stopped while abusing our resources

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.110.0030.00620.94
8.3.100.0000.01024.06
8.3.90.0090.00626.77
8.3.80.0030.00619.36
8.3.70.0180.00316.75
8.3.60.0150.00316.63
8.3.50.0110.00822.12
8.3.40.0170.00319.11
8.3.30.0120.00319.09
8.3.20.0000.00818.89
8.3.10.0040.00423.48
8.3.00.0000.00821.71
8.2.230.0080.00022.58
8.2.220.0040.00737.54
8.2.210.0080.00026.77
8.2.200.0060.00318.88
8.2.190.0150.00416.88
8.2.180.0180.00318.54
8.2.170.0110.00419.04
8.2.160.0110.00322.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00820.94
8.2.110.0070.00319.27
8.2.100.0080.00318.28
8.2.90.0040.00418.22
8.2.80.0000.00818.16
8.2.70.0040.00418.18
8.2.60.0040.00418.41
8.2.50.0060.00318.10
8.2.40.0030.00522.32
8.2.30.0000.00821.10
8.2.20.0000.00718.34
8.2.10.0040.00418.16
8.2.00.0040.00418.07
8.1.290.0060.00330.84
8.1.280.0120.00325.92
8.1.270.0080.00023.99
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00324.02
8.1.230.0090.00319.10
8.1.220.0000.00817.80
8.1.210.0000.00818.83
8.1.200.0070.00317.59
8.1.190.0000.00917.60
8.1.180.0000.00818.10
8.1.170.0030.00518.88
8.1.160.0000.00722.10
8.1.150.0000.00820.90
8.1.140.0080.00017.69
8.1.130.0030.00317.83
8.1.120.0000.00717.59
8.1.110.0040.00417.73
8.1.100.0000.00817.69
8.1.90.0080.00017.75
8.1.80.0000.00717.62
8.1.70.0000.00817.77
8.1.60.0080.00317.67
8.1.50.0030.00517.69
8.1.40.0080.00017.68
8.1.30.0000.00917.88
8.1.20.0050.00317.80
8.1.10.0000.00817.68
8.1.00.0090.00017.67
8.0.300.0040.00419.91
8.0.290.0060.00317.00
8.0.280.0000.00818.56
8.0.270.0030.00617.11
8.0.260.0040.00417.42
8.0.250.0070.00017.26
8.0.240.0040.00417.11
8.0.230.0070.00017.23
8.0.220.0030.00317.15
8.0.210.0050.00217.11
8.0.200.0030.00317.13
8.0.190.0040.00417.29
8.0.180.0040.00417.11
8.0.170.0050.00217.16
8.0.160.0060.00317.26
8.0.150.0040.00417.11
8.0.140.0000.00717.13
8.0.130.0030.00313.46
8.0.120.0060.00317.22
8.0.110.0050.00317.06
8.0.100.0040.00417.05
8.0.90.0040.00417.17
8.0.80.0040.01217.16
8.0.70.0000.00817.04
8.0.60.0080.00017.05
8.0.50.0040.00417.20
8.0.30.0090.01017.36
8.0.20.0090.00917.46
8.0.10.0040.00417.41
8.0.00.0140.00416.86
7.4.330.0000.00515.55
7.4.320.0040.00416.73
7.4.300.0030.00316.64
7.4.290.0000.00716.71
7.4.280.0030.00616.71
7.4.270.0050.00316.73
7.4.260.0040.00416.71
7.4.250.0040.00416.83
7.4.240.0000.00716.81
7.4.230.0070.00016.90
7.4.220.0160.00816.69
7.4.210.0070.00916.72
7.4.200.0030.00516.66
7.4.160.0100.00716.70
7.4.150.0120.00617.40
7.4.140.0130.00817.86
7.4.130.0120.00516.91
7.4.120.0060.01216.70
7.4.110.0070.01116.85
7.4.100.0150.00316.77
7.4.90.0060.01216.90
7.4.80.0040.01219.39
7.4.70.0100.00716.69
7.4.60.0090.00616.86
7.4.50.0070.01016.69
7.4.40.0130.00316.87
7.4.30.0170.00716.75
7.4.00.0040.01315.05
7.3.330.0000.00613.30
7.3.320.0040.00413.47
7.3.310.0030.00316.57
7.3.300.0030.00316.34
7.3.290.0030.00316.46
7.3.280.0090.00816.48
7.3.270.0160.00317.40
7.3.260.0080.01316.85
7.3.250.0110.00816.66
7.3.240.0100.00816.71
7.3.230.0000.01916.58
7.3.210.0090.00916.80
7.3.200.0180.00416.76
7.3.190.0070.01416.80
7.3.180.0090.01616.95
7.3.170.0130.00616.84
7.3.160.0130.00916.96
7.3.120.0030.01315.14
7.3.110.0100.00615.18
7.3.100.0090.00314.77
7.3.90.0090.00314.89
7.3.80.0060.00615.15
7.3.70.0030.01215.13
7.3.60.0070.00715.32
7.3.50.0040.00815.12
7.3.40.0070.00715.31
7.3.30.0040.00415.21
7.3.20.0060.00316.97
7.3.10.0080.01116.75
7.3.00.0100.00616.79
7.2.330.0150.00416.82
7.2.320.0090.00917.11
7.2.310.0000.01617.00
7.2.300.0130.01017.07
7.2.290.0060.01117.04
7.2.250.0090.00915.49
7.2.240.0000.02015.63
7.2.230.0040.00815.52
7.2.220.0070.00715.28
7.2.210.0000.01315.13
7.2.200.0090.00615.27
7.2.190.0090.00615.38
7.2.180.0070.01015.10
7.2.170.0030.01215.15
7.2.130.0140.00317.12
7.2.120.0090.00617.10
7.2.110.0150.01316.18
7.2.100.0130.00516.83
7.2.90.0150.01116.56
7.2.80.0190.00516.36
7.2.70.0160.01216.92
7.2.60.0100.00916.73
7.2.50.0080.00816.85
7.2.40.0090.01416.96
7.2.30.0080.01217.04
7.2.20.0160.00316.94
7.2.10.0120.01216.77
7.2.00.0080.00818.45
7.1.330.0100.00716.07
7.1.320.0060.00616.07
7.1.310.0060.00915.75
7.1.300.0030.01216.19
7.1.290.0100.00315.93
7.1.280.0070.01015.90
7.1.270.0100.00316.03
7.1.260.0070.00716.06
7.1.250.0110.00715.75
7.1.200.0060.00615.59
7.1.70.0000.01317.47
7.1.60.0030.01017.59
7.1.00.0000.07722.51
7.0.200.0190.00714.90
7.0.120.0330.07021.96
7.0.110.0100.08721.98
7.0.100.0270.08022.12
7.0.90.0270.06322.05
7.0.80.0100.06322.13
7.0.70.0230.06022.18
7.0.60.0370.07022.00
7.0.50.0230.08022.08
7.0.40.0130.07022.12
7.0.30.0200.06322.07
7.0.20.0230.07322.00
7.0.10.0130.06321.96
7.0.00.0200.06021.98
5.6.270.0300.08721.12
5.6.260.0230.06020.91
5.6.250.0130.08021.07
5.6.240.0430.07021.11
5.6.230.0170.08321.14
5.6.220.0270.08020.86
5.6.210.0200.07021.05
5.6.200.0230.06321.04
5.6.190.0330.05321.03
5.6.180.0270.06320.96
5.6.170.0130.08021.07
5.6.160.0070.07021.02
5.6.150.0170.07020.97
5.6.140.0200.06021.07
5.6.130.0170.06321.09
5.6.120.0230.05321.10
5.6.110.0300.06020.83
5.6.100.0200.06721.04
5.6.90.0170.06020.95
5.6.80.0300.06320.44
5.6.70.0200.07020.40
5.6.60.0400.06020.44
5.6.50.0170.06020.41
5.6.40.0200.05720.43
5.6.30.0300.06320.28
5.6.20.0270.05020.39
5.6.10.0130.07320.14
5.6.00.0100.06020.17

preferences:
117.2 ms | 4329 KiB | 5 Q