3v4l.org

run code in 300+ PHP versions simultaneously
<?php function RS_GET_DATE_WITH_DAYNAME_POSITION_FORMAT($day_name, $position = 'future', $format = 'Y-m-d H:i:s', $today_is_past = true) { $day = ucfirst($day_name); $today_name = date('l', time()); $today = date($format, time()); $next = date($format, strtotime('next '.$day_name)); $last = date($format, strtotime('last '.$day_name)); if($position == 'future') { if($today_name != $day_name) { return $next; } else { if($today_is_past) return $next; else return $today; } } else { if($today_name != $day_name) { return $last; } else { if($today_is_past) return $today; else return $last; } } } echo RS_GET_DATE_WITH_DAYNAME_POSITION_FORMAT('Sunday', 'past');

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)
7.3.120.0060.00915.13
7.3.110.0110.00315.03
7.3.100.0000.01414.96
7.3.90.0040.01115.10
7.3.80.0090.00915.16
7.3.70.0040.01214.66
7.3.60.0060.00614.86
7.3.50.0040.00814.81
7.3.40.0070.00715.05
7.3.30.0100.00614.81
7.3.20.0030.01316.82
7.3.10.0060.00916.63
7.3.00.0070.01016.91
7.2.240.0080.00615.29
7.2.230.0100.00315.23
7.2.220.0000.01015.35
7.2.210.0070.01015.16
7.2.200.0000.01315.40
7.2.190.0040.01515.36
7.2.180.0080.00515.44
7.2.170.0100.00315.24
7.2.160.0070.00715.00
7.2.150.0090.00617.18
7.2.140.0080.00317.02
7.2.130.0070.01017.09
7.2.120.0030.00917.24
7.2.110.0040.01116.89
7.2.100.0060.00917.20
7.2.90.0040.01217.02
7.2.80.0070.00417.19
7.2.70.0100.00317.15
7.2.60.0030.01317.09
7.2.50.0130.00316.98
7.2.40.0030.01417.18
7.2.30.0080.00817.25
7.2.20.0100.00317.00
7.2.10.0060.01016.95
7.2.00.0060.00918.22
7.1.330.0040.01115.85
7.1.320.0030.01415.96
7.1.310.0100.00716.03
7.1.300.0030.00715.94
7.1.290.0060.00915.88
7.1.280.0060.00315.72
7.1.270.0000.01615.92
7.1.260.0110.00415.92
7.1.250.0040.01115.60
7.1.200.0100.00015.81
7.1.100.0040.01218.43
7.1.70.0060.00617.08
7.1.60.0030.02319.40
7.1.50.0030.01617.18
7.1.00.0030.07722.44
7.0.200.0030.00716.99
7.0.140.0100.06721.99
7.0.120.0000.03321.98
7.0.80.0630.08020.02
7.0.70.0100.03719.93
7.0.60.0070.08720.08
7.0.50.0170.06320.44
7.0.40.0100.08320.13
7.0.30.0000.08020.14
7.0.20.0130.08719.95
7.0.10.0070.07720.12
7.0.00.0070.08719.94
5.6.280.0030.07321.07
5.6.230.0070.08320.61
5.6.220.0030.07720.62
5.6.210.0030.08320.62
5.6.200.0130.08021.01
5.6.190.0130.07721.14
5.6.180.0070.06721.13
5.6.170.0000.06721.09
5.6.160.0200.07321.02
5.6.150.0200.07021.08
5.6.140.0070.08321.09
5.6.130.0200.07321.04
5.6.120.0070.08321.11
5.6.110.0070.08721.00
5.6.100.0100.08020.93
5.6.90.0030.08021.09
5.6.80.0070.05020.56
5.6.70.0100.05020.30
5.6.60.0130.06320.45
5.6.50.0070.08020.43
5.6.40.0070.08720.36
5.6.30.0270.04020.39
5.6.20.0100.03320.43
5.6.10.0130.07320.46
5.6.00.0100.07320.48
5.5.370.0170.07020.50
5.5.360.0070.08020.49
5.5.350.0130.07320.45
5.5.340.0130.08020.91
5.5.330.0100.08020.89
5.5.320.0100.08020.80
5.5.310.0100.05320.74
5.5.300.0000.08020.84
5.5.290.0070.07020.86
5.5.280.0100.08320.78
5.5.270.0200.06720.73
5.5.260.0100.08020.76
5.5.250.0170.05320.72
5.5.240.0100.07320.25
5.5.230.0130.06720.21
5.5.220.0130.07720.28
5.5.210.0100.07320.27
5.5.200.0030.06320.14
5.5.190.0100.07020.16
5.5.180.0070.08020.28
5.5.160.0100.08320.26
5.5.150.0100.07320.23
5.5.140.0100.04320.11
5.5.130.0100.07320.08
5.5.120.0170.05720.19
5.5.110.0100.06720.22
5.5.100.0000.05320.05
5.5.90.0070.07320.16
5.5.80.0030.08320.20
5.5.70.0070.07720.06
5.5.60.0000.08320.00
5.5.50.0130.07019.94
5.5.40.0100.07719.93
5.5.30.0130.06720.02
5.5.20.0200.06019.95
5.5.10.0130.07720.00
5.5.00.0100.06019.97
5.4.450.0070.07019.45
5.4.440.0270.06719.44
5.4.430.0100.07019.22
5.4.420.0170.07319.41
5.4.410.0070.06319.32
5.4.400.0200.07019.09
5.4.390.0030.08719.04
5.4.380.0070.07718.88
5.4.370.0100.07719.10
5.4.360.0070.05019.04
5.4.350.0270.06319.05
5.4.340.0030.04719.04
5.4.320.0100.07719.13
5.4.310.0130.06719.21
5.4.300.0000.07019.02
5.4.290.0100.07019.15
5.4.280.0100.07019.14
5.4.270.0170.06319.06
5.4.260.0130.07018.85
5.4.250.0030.08019.12
5.4.240.0200.07019.02
5.4.230.0070.07019.13
5.4.220.0100.05019.20
5.4.210.0030.07719.17
5.4.200.0100.05319.20
5.4.190.0030.08319.17
5.4.180.0070.08018.93
5.4.170.0130.07319.22
5.4.160.0100.06019.16
5.4.150.0200.06718.85
5.4.140.0100.07016.41
5.4.130.0170.04316.33
5.4.120.0130.05716.34
5.4.110.0130.06316.50
5.4.100.0070.07016.43
5.4.90.0100.07316.51
5.4.80.0100.03716.25
5.4.70.0030.05016.32
5.4.60.0030.07016.46
5.4.50.0070.07016.30
5.4.40.0070.06316.41
5.4.30.0070.06016.48
5.4.20.0030.08016.24
5.4.10.0030.05016.48
5.4.00.0070.07715.63
5.3.290.0000.04714.72
5.3.280.0130.07314.68
5.3.270.0030.08314.57
5.3.260.0170.07014.58
5.3.250.0030.05014.63
5.3.240.0170.06714.58
5.3.230.0030.08014.61
5.3.220.0130.03714.52
5.3.210.0130.07314.68
5.3.200.0030.03714.53
5.3.190.0100.07714.52
5.3.180.0100.05314.59
5.3.170.0030.06314.63
5.3.160.0030.06014.50
5.3.150.0070.06314.52
5.3.140.0030.06314.57
5.3.130.0070.08014.57
5.3.120.0170.06314.66
5.3.110.0000.08714.51
5.3.100.0070.06714.10
5.3.90.0030.07313.98
5.3.80.0070.05714.04
5.3.70.0170.06714.07
5.3.60.0000.08013.99
5.3.50.0070.07714.04
5.3.40.0100.06013.97
5.3.30.0130.06313.96
5.3.20.0030.07713.78
5.3.10.0070.05713.55
5.3.00.0100.05713.63
5.2.170.0070.06311.27
5.2.160.0070.06011.16
5.2.150.0030.06311.25
5.2.140.0100.06311.16
5.2.130.0100.05711.13
5.2.120.0070.06711.16
5.2.110.0030.05711.11
5.2.100.0070.06011.13
5.2.90.0030.04011.13
5.2.80.0070.04711.13
5.2.70.0000.03711.23
5.2.60.0100.05311.17
5.2.50.0070.05711.14
5.2.40.0030.03711.07
5.2.30.0030.06310.88
5.2.20.0130.03310.86
5.2.10.0070.06010.87
5.2.00.0070.05710.74
5.1.60.0070.05010.06
5.1.50.0030.05310.13
5.1.40.0030.05310.04
5.1.30.0030.06010.34
5.1.20.0030.05710.38
5.1.10.0070.05010.13
5.1.00.0070.05310.16
5.0.50.0030.0338.55
5.0.40.0070.0438.42
5.0.30.0070.0678.23
5.0.20.0000.0378.06
5.0.10.0030.0438.27
5.0.00.0170.0438.23
4.4.90.0030.0307.29
4.4.80.0000.0207.29
4.4.70.0000.0407.29
4.4.60.0030.0377.29
4.4.50.0000.0377.29
4.4.40.0000.0437.29
4.4.30.0070.0277.29
4.4.20.0030.0377.29
4.4.10.0070.0237.29
4.4.00.0030.0337.29
4.3.110.0030.0377.29
4.3.100.0000.0377.29
4.3.90.0070.0307.29
4.3.80.0030.0407.29
4.3.70.0000.0207.29
4.3.60.0030.0207.29
4.3.50.0070.0307.29
4.3.40.0000.0507.29
4.3.30.0000.0407.29
4.3.20.0030.0337.29
4.3.10.0070.0337.29
4.3.00.0030.0207.29

preferences:
28.11 ms | 400 KiB | 5 Q