3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('America/Toronto'); $start_day = 'tue'; $start_time = 181300; $end_day = 'fri'; $end_time = 134500; $startDate = DateTime::createFromFormat ( 'D His', $start_day . ' '. $start_time); $endDate = DateTime::createFromFormat ( 'D His', $end_day . ' '. $end_time); $startHour = $startDate->format('G'); //24-hour format of an hour without leading zeros $startDay = $startDate->format('N'); //numeric representation of the day of the week $endHour = $endDate->format('G'); //24-hour format of an hour without leading zeros $endDay = $endDate->format('N'); //numeric representation of the day of the week //We Need to check the time is between Tuesday 6PM ( 2 and 18 for $startDay and $startHour respectively ) to Friday 6PM ( ( 5 and 18 for $endDay and $endHour respectively )) if ( $startDay >= 2 && $endDay <= 5 && $startHour >= 18 and $endHour <= 18 ) { echo 'Within Time Range'; } else { echo 'Outside Range'; }

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.140.0130.00817.61
8.4.130.0110.00919.08
8.4.120.0120.00820.46
8.4.110.0120.00622.32
8.4.100.0140.00618.83
8.4.90.0120.00918.61
8.4.80.0140.00718.77
8.4.70.0080.00818.27
8.4.60.0160.00918.97
8.4.50.0130.00818.68
8.4.40.0090.00019.43
8.4.30.0060.01320.25
8.4.20.0130.00318.88
8.4.10.0170.00317.89
8.3.260.0120.00816.55
8.3.250.0100.00718.79
8.3.240.0100.00917.39
8.3.230.0140.00716.72
8.3.220.0130.00518.96
8.3.210.0110.00816.84
8.3.200.0050.00416.49
8.3.190.0090.01018.67
8.3.180.0100.00916.55
8.3.170.0120.00618.73
8.3.160.0040.01417.05
8.3.150.0100.01018.81
8.3.140.0200.00016.79
8.3.130.0060.00316.57
8.3.120.0120.00320.92
8.3.110.0150.00420.94
8.3.100.0040.00416.79
8.3.90.0090.00618.55
8.3.80.0070.00418.55
8.3.70.0160.00618.30
8.3.60.0070.01318.43
8.3.50.0070.01317.60
8.3.40.0040.01118.70
8.3.30.0100.01318.85
8.3.20.0000.00820.55
8.3.10.0080.00021.92
8.3.00.0040.00422.50
8.2.290.0040.00720.44
8.2.280.0090.01018.55
8.2.270.0060.01217.30
8.2.260.0030.01419.11
8.2.250.0030.00518.61
8.2.240.0080.00017.50
8.2.230.0060.00322.58
8.2.220.0030.00524.06
8.2.210.0040.00426.77
8.2.200.0090.00018.27
8.2.190.0070.01516.88
8.2.180.0090.00916.88
8.2.170.0090.00622.96
8.2.160.0070.00721.98
8.2.150.0050.00324.18
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0000.00826.16
8.2.110.0040.00420.52
8.2.100.0130.00017.84
8.2.90.0060.00320.73
8.2.80.0050.00318.18
8.2.70.0040.00418.05
8.2.60.0030.00618.34
8.2.50.0080.00018.10
8.2.40.0040.00419.55
8.2.30.0040.00419.36
8.2.20.0040.00418.16
8.2.10.0000.00721.46
8.2.00.0000.00719.44
8.1.330.0130.00622.27
8.1.320.0080.01116.23
8.1.310.0040.00416.80
8.1.300.0050.00316.79
8.1.290.0030.00618.88
8.1.280.0070.01325.92
8.1.270.0040.00423.96
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0150.00323.82
8.1.230.0110.00020.98
8.1.220.0000.00817.88
8.1.210.0070.00019.04
8.1.200.0080.00017.48
8.1.190.0000.00817.35
8.1.180.0040.00419.15
8.1.170.0000.00818.69
8.1.160.0040.00419.02
8.1.150.0040.00418.99
8.1.140.0040.00421.98
8.1.130.0070.00017.71
8.1.120.0070.00017.65
8.1.110.0030.00517.68
8.1.100.0060.00317.68
8.1.90.0040.00417.69
8.1.80.0040.00417.62
8.1.70.0030.00517.63
8.1.60.0040.00417.62
8.1.50.0040.00417.57
8.1.40.0080.00017.68
8.1.30.0000.00817.80
8.1.20.0040.00417.74
8.1.10.0000.00817.61
8.1.00.0050.00317.66
8.0.300.0040.00420.01
8.0.290.0040.00416.88
8.0.280.0030.00318.59
8.0.270.0030.00317.31
8.0.260.0000.00617.04
8.0.250.0030.00317.20
8.0.240.0030.00317.13
8.0.230.0070.00017.22
8.0.220.0030.00617.17
8.0.210.0080.00017.04
8.0.200.0000.00617.21
8.0.190.0040.00417.14
8.0.180.0000.00717.21
8.0.170.0050.00317.19
8.0.160.0050.00217.16
8.0.150.0030.00517.06
8.0.140.0000.00816.98
8.0.130.0000.00513.62
8.0.120.0000.00817.08
8.0.110.0000.00717.03
8.0.100.0040.00417.15
8.0.90.0000.00817.02
8.0.80.0070.00717.14
8.0.70.0000.00717.21
8.0.60.0040.00417.24
8.0.50.0050.00217.15
8.0.30.0120.00617.08
8.0.20.0050.01517.31
8.0.10.0040.00417.26
8.0.00.0070.01017.13
7.4.330.0000.00515.55
7.4.320.0030.00316.75
7.4.300.0030.00316.71
7.4.290.0070.00016.63
7.4.280.0030.00516.59
7.4.270.0030.00316.56
7.4.260.0000.00613.47
7.4.250.0070.00016.71
7.4.240.0040.00416.63
7.4.230.0000.00716.62
7.4.220.0000.00716.64
7.4.210.0070.01316.66
7.4.200.0030.00316.74
7.4.130.0170.00716.52
7.4.120.0090.00916.73
7.4.110.0120.00616.75
7.4.100.0190.00616.67
7.4.90.0110.00716.63
7.4.80.0140.00319.39
7.4.70.0070.01016.54
7.4.60.0150.00716.53
7.4.50.0110.00416.44
7.4.40.0040.01216.97
7.4.00.0060.00614.92
7.3.330.0030.00516.46
7.3.320.0060.00013.24
7.3.310.0030.00316.35
7.3.300.0030.00316.44
7.3.290.0070.00016.29
7.3.280.0060.00916.32
7.3.260.0080.01016.54
7.3.240.0080.01016.50
7.3.230.0110.01116.63
7.3.210.0170.00016.69
7.3.200.0060.00916.35
7.3.190.0110.00616.52
7.3.180.0100.01016.65
7.3.170.0100.00716.66
7.3.160.0170.00316.56
7.3.100.0460.00814.83
7.3.90.0650.01015.03
7.3.80.0140.00814.95
7.3.70.0770.00714.97
7.3.60.0130.00914.89
7.3.50.0120.00714.90
7.3.40.0230.01314.86
7.3.30.0120.00714.87
7.3.20.0640.01014.96
7.3.10.0510.00714.94
7.3.00.0190.00714.59
7.2.330.0130.00316.83
7.2.320.0130.00316.93
7.2.310.0060.01117.12
7.2.300.0160.00617.10
7.2.290.0030.01416.99
7.2.220.0140.00915.10
7.2.210.0120.01015.24
7.2.200.0160.00515.23
7.2.190.0100.01215.07
7.2.180.0110.00815.10
7.2.170.0150.00415.09
7.2.160.0130.00815.30
7.2.150.0770.01015.36
7.2.140.0850.00815.30
7.2.130.0840.01115.28
7.2.120.0510.00815.22
7.2.110.0280.00615.19
7.2.100.0710.01315.41
7.2.90.0260.00615.32
7.2.80.0560.01315.20
7.2.70.0580.01315.16
7.2.60.0590.01115.04
7.2.50.0510.01115.16
7.2.40.0630.00314.86
7.2.30.0730.00314.89
7.2.20.0560.00914.87
7.2.10.0700.00614.95
7.2.00.0580.00314.91
7.1.320.0650.01214.12
7.1.310.0610.01413.98
7.1.300.0890.00914.02
7.1.290.0550.00913.96
7.1.280.0630.00714.05
7.1.270.0410.00814.03
7.1.260.0660.00513.94
7.1.250.0470.01114.14

preferences:
42.37 ms | 403 KiB | 5 Q