3v4l.org

run code in 300+ PHP versions simultaneously
<?php function datediffInWeeks($date1, $date2) { if($date1 > $date2) return datediffInWeeks($date2, $date1); $first = DateTime::createFromFormat('m/d/Y', $date1); $second = DateTime::createFromFormat('m/d/Y', $date2); return floor($first->diff($second)->days/7); } var_dump(datediffInWeeks('1/2/2013', '6/4/2013'));// 21 var_dump(datediffInWeeks('6/4/2013', '1/2/2013'));// 21

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.10.0060.00617.67
8.3.140.0060.00316.88
8.3.130.0040.00418.27
8.3.120.0030.00620.71
8.3.110.0110.00416.63
8.3.100.0100.00624.06
8.3.90.0060.00926.77
8.3.80.0030.00616.73
8.3.70.0080.00816.58
8.3.60.0140.00516.50
8.3.50.0120.00922.14
8.3.40.0150.00019.02
8.3.30.0140.00019.09
8.3.20.0040.00420.42
8.3.10.0080.00622.03
8.3.00.0050.00919.97
8.2.260.0050.00318.70
8.2.250.0190.00018.30
8.2.240.0090.00017.23
8.2.230.0090.00020.94
8.2.220.0070.00337.54
8.2.210.0070.00726.77
8.2.200.0050.00518.30
8.2.190.0090.00616.58
8.2.180.0090.00918.38
8.2.170.0090.00622.96
8.2.160.0070.00720.35
8.2.150.0130.00925.66
8.2.140.0070.00622.55
8.2.130.0060.00723.31
8.2.120.0110.00220.09
8.2.110.0080.01019.83
8.2.100.0140.00618.47
8.2.90.0020.01118.46
8.2.80.0020.01018.49
8.2.70.0080.00933.44
8.2.60.0120.00333.60
8.2.50.0120.00528.87
8.2.40.0120.00427.46
8.2.30.0120.00327.29
8.2.20.0080.00827.24
8.2.10.0110.00424.45
8.2.00.0090.00726.06
8.1.300.0030.00620.33
8.1.290.0090.00030.84
8.1.280.0070.00725.92
8.1.270.0070.00423.08
8.1.260.0060.00524.28
8.1.250.0060.00525.20
8.1.240.0100.00221.27
8.1.230.0080.00221.38
8.1.220.0010.00718.41
8.1.210.0030.00518.72
8.1.200.0080.00533.24
8.1.190.0120.00433.19
8.1.180.0110.00328.64
8.1.170.0060.00727.06
8.1.160.0110.00427.23
8.1.150.0090.00627.25
8.1.140.0120.00425.94
8.1.130.0100.00525.90
8.1.120.0100.00425.00
8.1.110.0090.00625.03
8.1.100.0070.00724.29
8.1.90.0110.00524.24
8.1.80.0080.00624.29
8.1.70.0090.00424.26
8.1.60.0100.00623.69
8.1.50.0120.00422.70
8.1.40.0130.00322.40
8.1.30.0110.00622.12
8.1.20.0120.00522.09
8.1.10.0120.00521.79
8.1.00.0130.00521.12
8.0.300.0000.00718.39
8.0.290.0110.00532.77
8.0.280.0120.00227.05
8.0.270.0100.00424.70
8.0.260.0100.00525.76
8.0.250.0110.00324.68
8.0.240.0120.00324.69
8.0.230.0100.00523.94
8.0.220.0110.00423.91
8.0.210.0100.00523.93
8.0.200.0110.00323.96
8.0.190.0120.00323.31
8.0.180.0100.00522.37
8.0.170.0110.00421.97
8.0.160.0110.00521.70
8.0.150.0100.00621.64
8.0.140.0110.00420.86
8.0.130.0110.00420.84
8.0.120.0090.00721.13
8.0.110.0100.00520.87
8.0.100.0100.00520.66
8.0.90.0110.00420.65
8.0.80.0110.00420.69
8.0.70.0120.00520.46
8.0.60.0110.00520.66
8.0.50.0110.00520.65
8.0.30.0120.00520.34
8.0.20.0120.00720.10
8.0.10.0120.00620.28
8.0.00.0110.00620.10
7.4.330.0090.00223.50
7.4.320.0120.00424.42
7.4.300.0100.00523.63
7.4.290.0120.00522.05
7.4.280.0120.00521.01
7.4.270.0110.00520.55
7.4.260.0110.00520.77
7.4.250.0140.00420.79
7.4.240.0120.00520.16
7.4.230.0120.00420.35
7.4.220.0110.00520.31
7.4.210.0110.00520.18
7.4.200.0110.00420.18
7.4.190.0130.00420.59
7.4.180.0110.00520.58
7.4.160.0130.00520.17
7.4.150.0130.00619.87
7.4.140.0110.00619.63
7.4.130.0120.00519.54
7.4.120.0110.00619.55
7.4.110.0110.00519.50
7.4.100.0130.00419.55
7.4.90.0110.00619.50
7.4.80.0110.00519.62
7.4.70.0110.00619.42
7.4.60.0100.00619.39
7.4.50.0090.00719.35
7.4.40.0110.00619.13
7.4.30.0110.00619.27
7.4.20.0100.00719.18
7.4.10.0100.00618.92
7.4.00.0110.00618.56
7.3.330.0160.00320.97
7.3.320.0140.00420.38
7.3.310.0130.00420.38
7.3.300.0090.00720.15
7.3.290.0130.00320.17
7.3.280.0110.00519.80
7.3.270.0120.00619.70
7.3.260.0120.00619.52
7.3.250.0120.00619.45
7.3.240.0110.00519.55
7.3.230.0120.00519.42
7.3.220.0110.00519.53
7.3.210.0100.00719.48
7.3.200.0100.00719.56
7.3.190.0120.00519.33
7.3.180.0100.00719.34
7.3.170.0100.00719.37
7.3.160.0110.00619.24
7.3.150.0130.00519.24
7.3.140.0120.00519.16
7.3.130.0100.00718.85
7.3.120.0120.00618.58
7.3.110.0120.00618.33
7.3.100.0110.00618.14
7.3.90.0100.00717.97
7.3.80.0100.00717.82
7.3.70.0090.00817.73
7.3.60.0100.00717.63
7.3.50.0100.00717.59
7.3.40.0110.00717.60
7.3.30.0100.00717.56
7.3.20.0130.00718.00
7.3.10.0180.00717.88
7.3.00.0160.00717.82
7.2.340.0120.00719.64
7.2.330.0140.00619.50
7.2.320.0140.00619.62
7.2.310.0140.00619.41
7.2.300.0140.00519.49
7.2.290.0130.00619.31
7.2.280.0120.00719.27
7.2.270.0120.00719.21
7.2.260.0130.00618.91
7.2.250.0130.00618.70
7.2.240.0120.00818.45
7.2.230.0130.00718.25
7.2.220.0120.00718.02
7.2.210.0110.00717.92
7.2.200.0120.00717.87
7.2.190.0110.00717.78
7.2.180.0110.00817.72
7.2.170.0110.00817.73
7.2.160.0110.00717.64
7.2.150.0180.00718.12
7.2.140.0160.00718.14
7.2.130.0180.00818.04
7.2.120.0200.00717.91
7.2.110.0190.00817.90
7.2.100.0220.00717.79
7.2.90.0230.00817.71
7.2.80.0340.00717.72
7.2.70.0340.00717.74
7.2.60.0310.00817.73
7.2.50.0290.00617.74
7.2.40.0280.00817.78
7.2.30.0310.00717.79
7.2.20.0300.00817.80
7.2.10.0280.00717.80
7.2.00.0240.00717.81
7.1.330.0170.00618.28
7.1.320.0120.00717.79
7.1.310.0140.00717.75
7.1.300.0120.00717.48
7.1.290.0140.00617.45
7.1.280.0130.00617.38
7.1.270.0170.00717.31
7.1.260.0130.00717.27
7.1.250.0200.00617.09
7.1.240.0210.00816.97
7.1.230.0200.00716.99
7.1.220.0210.00716.92
7.1.210.0310.00816.84
7.1.200.0320.00716.83
7.1.190.0280.00716.83
7.1.180.0290.00816.77
7.1.170.0320.00616.79
7.1.160.0260.00816.82
7.1.150.0310.00716.83
7.1.140.0290.00616.85
7.1.130.0290.00716.84
7.1.120.0260.00816.86
7.1.110.0330.00716.85
7.1.100.0280.00716.82
7.1.90.0260.00616.83
7.1.80.0260.00716.86
7.1.70.0260.00716.83
7.1.60.0240.00617.92
7.1.50.0230.00717.93
7.1.40.0240.00617.91
7.1.30.0240.00817.90
7.1.20.0250.00617.87
7.1.10.0220.00716.87
7.1.00.0250.00716.82
7.0.330.0220.00716.71
7.0.320.0270.00616.65
7.0.310.0240.00716.49
7.0.300.0320.00716.46
7.0.290.0290.00616.49
7.0.280.0300.00716.49
7.0.270.0290.00716.48
7.0.260.0340.00716.49
7.0.250.0310.00716.59
7.0.240.0310.00616.57
7.0.230.0250.00716.61
7.0.220.0290.00716.61
7.0.210.0210.00716.61
7.0.200.0230.00716.58
7.0.190.0210.00616.59
7.0.180.0220.00716.60
7.0.170.0250.00616.63
7.0.160.0210.00616.60
7.0.150.0290.00716.54
7.0.140.0240.00716.54
7.0.130.0260.00616.58
7.0.120.0220.00616.61
7.0.110.0220.00716.58
7.0.100.0220.00716.57
7.0.90.0230.00716.54
7.0.80.0200.00616.57
7.0.70.0230.00616.55
7.0.60.0230.00716.56
7.0.50.0230.00616.58
7.0.40.0200.00716.60
7.0.30.0230.00716.61
7.0.20.0220.00716.53
7.0.10.0220.00716.62
7.0.00.0230.00716.59
5.6.400.0140.00817.13
5.6.390.0120.00817.07
5.6.380.0130.00816.74
5.6.370.0130.00816.78
5.6.360.0130.00816.78
5.6.350.0130.00816.76
5.6.340.0120.00916.81
5.6.330.0140.00716.79
5.6.320.0130.00716.80
5.6.310.0130.00916.81
5.6.300.0130.00816.64
5.6.290.0120.00816.67
5.6.280.0130.00716.71
5.6.270.0130.00716.71
5.6.260.0120.00816.71
5.6.250.0140.00716.70
5.6.240.0130.00816.68
5.6.230.0130.00716.73
5.6.220.0130.00816.65
5.6.210.0130.00716.70
5.6.200.0140.00616.74
5.6.190.0130.00816.74
5.6.180.0130.00716.70
5.6.170.0130.00716.69
5.6.160.0120.00816.71
5.6.150.0130.00716.71
5.6.140.0130.00816.73
5.6.130.0130.00816.72
5.6.120.0130.00816.73
5.6.110.0120.00916.69
5.6.100.0130.00816.68
5.6.90.0140.00716.65
5.6.80.0110.00916.64
5.6.70.0130.00716.66
5.6.60.0130.00816.67
5.6.50.0120.00816.62
5.6.40.0130.00716.65
5.6.30.0130.00716.64
5.6.20.0130.00716.64
5.6.10.0130.00816.64
5.6.00.0130.00716.62
5.5.380.0120.00716.23
5.5.370.0130.00716.28
5.5.360.0130.00716.18
5.5.350.0120.00716.18
5.5.340.0130.00716.16
5.5.330.0130.00716.15
5.5.320.0120.00716.17
5.5.310.0130.00716.16
5.5.300.0130.00816.19
5.5.290.0130.00716.21
5.5.280.0120.00816.21
5.5.270.0120.00716.16
5.5.260.0130.00716.19
5.5.250.0120.00816.16
5.5.240.0120.00716.18
5.5.230.0130.00716.13
5.5.220.0120.00816.15
5.5.210.0120.00716.19
5.5.200.0130.00716.09
5.5.190.0140.00616.13
5.5.180.0130.00716.14
5.5.170.0120.00916.44
5.5.160.0120.00716.18
5.5.150.0120.00716.17
5.5.140.0130.00716.10
5.5.130.0120.00716.12
5.5.120.0130.00816.10
5.5.110.0120.00716.10
5.5.100.0130.00716.15
5.5.90.0130.00616.16
5.5.80.0110.00816.13
5.5.70.0130.00716.19
5.5.60.0130.00716.18
5.5.50.0120.00816.14
5.5.40.0130.00716.14
5.5.30.0120.00716.10
5.5.20.0120.00716.18
5.5.10.0120.00716.09
5.5.00.0130.00716.11
5.4.450.0100.00614.04
5.4.440.0110.00514.06
5.4.430.0100.00614.03
5.4.420.0110.00514.03
5.4.410.0100.00514.02
5.4.400.0100.00613.98
5.4.390.0090.00613.98
5.4.380.0090.00613.98
5.4.370.0110.00513.98
5.4.360.0100.00513.97
5.4.350.0110.00513.99
5.4.340.0110.00514.00
5.4.330.0100.00513.99
5.4.320.0110.00514.00
5.4.310.0110.00514.00
5.4.300.0100.00514.00
5.4.290.0100.00514.02
5.4.280.0100.00513.99
5.4.270.0110.00414.01
5.4.260.0110.00514.00
5.4.250.0100.00513.97
5.4.240.0100.00613.97
5.4.230.0100.00513.92
5.4.220.0100.00613.93
5.4.210.0090.00613.93
5.4.200.0110.00513.94
5.4.190.0110.00413.93
5.4.180.0100.00513.95
5.4.170.0100.00513.94
5.4.160.0100.00613.97
5.4.150.0110.00513.93
5.4.140.0100.00513.99
5.4.130.0100.00513.99
5.4.120.0100.00613.99
5.4.110.0100.00514.01
5.4.100.0100.00614.01
5.4.90.0100.00513.96
5.4.80.0090.00514.01
5.4.70.0090.00614.01
5.4.60.0110.00514.00
5.4.50.0100.00513.96
5.4.40.0090.00614.01
5.4.30.0090.00614.02
5.4.20.0090.00514.01
5.4.10.0100.00514.01
5.4.00.0090.00613.98

preferences:
64.58 ms | 403 KiB | 5 Q