3v4l.org

run code in 300+ PHP versions simultaneously
<?php function RS_GET_DATE_WITH_DAYNAME_POSITION_FORMAT($day_name, $position = 'future', $today_is_past = true, $format = 'Y-m-d H:i:s') { $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('Wednesday', 'future', true);

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.4.00.0100.00314.89
7.3.120.0180.00015.08
7.3.110.0070.01415.00
7.3.100.0130.00015.13
7.3.90.0080.00315.11
7.3.80.0030.01014.77
7.3.70.0070.00714.95
7.3.60.0030.00615.17
7.3.50.0090.00615.09
7.3.40.0100.00314.92
7.3.30.0000.01315.02
7.3.20.0050.00516.55
7.3.10.0120.00516.63
7.3.00.0100.00516.60
7.2.250.0070.01515.21
7.2.240.0040.01414.99
7.2.230.0000.01415.38
7.2.220.0000.01215.21
7.2.210.0040.01115.43
7.2.200.0060.01015.04
7.2.190.0070.00715.26
7.2.180.0070.00415.04
7.2.170.0060.00915.20
7.2.130.0140.00916.95
7.2.120.0190.00016.41
7.2.110.0150.00716.61
7.2.100.0070.01516.67
7.2.90.0160.00516.64
7.2.80.0190.00416.57
7.2.70.0140.00916.34
7.2.60.0110.00817.07
7.2.50.0170.00816.76
7.2.40.0140.00716.89
7.2.30.0170.00416.79
7.2.20.0170.00716.86
7.2.10.0170.00716.89
7.2.00.0110.00618.15
7.1.330.0060.00616.05
7.1.320.0040.00416.13
7.1.310.0030.01015.94
7.1.300.0070.00415.82
7.1.290.0070.00315.77
7.1.280.0060.00316.16
7.1.270.0000.01116.11
7.1.260.0110.00415.89
7.1.250.0030.01015.71
7.1.200.0110.00316.14
7.1.100.0090.00318.32
7.1.70.0030.00917.23
7.1.60.0130.01319.40
7.1.50.0030.01017.03
7.1.00.0070.07322.51
7.0.200.0040.00417.07
7.0.140.0030.07321.95
7.0.120.0000.03322.05
7.0.100.0470.07019.98
7.0.90.0370.09020.03
7.0.80.0400.07319.93
7.0.70.0330.08020.02
7.0.60.0330.06019.79
7.0.50.0400.09020.20
7.0.40.0100.07720.08
7.0.30.0030.04720.09
7.0.20.0070.05320.10
7.0.10.0130.04020.12
7.0.00.0070.08720.04
5.6.280.0030.07321.14
5.6.250.0000.08720.48
5.6.240.0100.09020.69
5.6.230.0070.08720.59
5.6.220.0070.06720.61
5.6.210.0070.08320.46
5.6.200.0100.08321.04
5.6.190.0130.06720.95
5.6.180.0030.05721.06
5.6.170.0130.07321.04
5.6.160.0030.08321.14
5.6.150.0130.07321.02
5.6.140.0030.04721.06
5.6.130.0070.08321.06
5.6.120.0070.08020.95
5.6.110.0170.05721.13
5.6.100.0070.06321.10
5.6.90.0000.09020.99
5.6.80.0000.05020.43
5.6.70.0100.07720.43
5.6.60.0070.07320.29
5.6.50.0030.04720.50
5.6.40.0130.07020.32
5.6.30.0000.08020.49
5.6.20.0200.06720.38
5.6.10.0100.04720.37
5.6.00.0100.04020.51
5.5.380.0130.08020.38
5.5.370.0030.05020.38
5.5.360.0030.04720.36
5.5.350.0070.07320.46
5.5.340.0130.08320.77
5.5.330.0100.09020.94
5.5.320.0070.08020.88
5.5.310.0030.09020.80
5.5.300.0100.05320.83
5.5.290.0100.07020.86
5.5.280.0030.05720.73
5.5.270.0030.07720.91
5.5.260.0130.07720.79
5.5.250.0070.08020.59
5.5.240.0030.07720.18
5.5.230.0030.04020.27
5.5.220.0070.06720.26
5.5.210.0030.08320.27
5.5.200.0130.04320.15
5.5.190.0170.06320.10
5.5.180.0070.07320.15
5.5.160.0000.08720.00
5.5.150.0130.05020.23
5.5.140.0030.08720.23
5.5.130.0100.08020.24
5.5.120.0070.08020.11
5.5.110.0100.04320.21
5.5.100.0070.07720.10
5.5.90.0030.07320.07
5.5.80.0030.07319.95
5.5.70.0100.07720.15
5.5.60.0070.04020.06
5.5.50.0170.06320.05
5.5.40.0070.06720.06
5.5.30.0130.03720.15
5.5.20.0030.08320.15
5.5.10.0200.05719.98
5.5.00.0070.04320.04
5.4.450.0100.04319.37
5.4.440.0070.07319.45
5.4.430.0070.06319.19
5.4.420.0130.05319.46
5.4.410.0030.04319.36
5.4.400.0000.08018.91
5.4.390.0030.04718.90
5.4.380.0070.07019.09
5.4.370.0130.06718.95
5.4.360.0330.04318.95
5.4.350.0030.08319.12
5.4.340.0100.07718.85
5.4.320.0030.07719.05
5.4.310.0030.07019.04
5.4.300.0000.05718.94
5.4.290.0070.07319.11
5.4.280.0070.07019.04
5.4.270.0030.05019.15
5.4.260.0230.06319.13
5.4.250.0100.05019.02
5.4.240.0000.07719.08
5.4.230.0130.05319.13
5.4.220.0100.07719.22
5.4.210.0030.04719.23
5.4.200.0070.04319.02
5.4.190.0030.08019.16
5.4.180.0030.08319.07
5.4.170.0130.06019.13
5.4.160.0030.07718.86
5.4.150.0170.07319.06
5.4.140.0200.05716.33
5.4.130.0100.07316.45
5.4.120.0000.06016.42
5.4.110.0100.07016.43
5.4.100.0070.07016.29
5.4.90.0130.06316.34
5.4.80.0070.03716.36
5.4.70.0070.04716.48
5.4.60.0070.04716.36
5.4.50.0070.07316.40
5.4.40.0070.06716.38
5.4.30.0100.05716.33
5.4.20.0030.08016.45
5.4.10.0100.06016.36
5.4.00.0100.03315.78
5.3.290.0100.07314.64
5.3.280.0070.07014.57
5.3.270.0070.07314.72
5.3.260.0070.08014.68
5.3.250.0170.06714.52
5.3.240.0070.05314.69
5.3.230.0100.06714.54
5.3.220.0070.07314.50
5.3.210.0130.06014.54
5.3.200.0100.07314.61
5.3.190.0070.07714.54
5.3.180.0030.07714.51
5.3.170.0070.06314.67
5.3.160.0070.08014.54
5.3.150.0130.06314.53
5.3.140.0070.07314.56
5.3.130.0070.07014.59
5.3.120.0030.08314.61
5.3.110.0070.07314.48
5.3.100.0070.07714.03
5.3.90.0100.07314.16
5.3.80.0070.08314.08
5.3.70.0130.06714.00
5.3.60.0100.07314.11
5.3.50.0070.06714.09
5.3.40.0070.05713.85
5.3.30.0030.08014.04
5.3.20.0100.07313.76
5.3.10.0100.06713.71
5.3.00.0070.06713.67
5.2.170.0000.04312.69
5.2.160.0030.06012.69
5.2.150.0030.06712.69
5.2.140.0030.04312.69
5.2.130.0100.05712.69
5.2.120.0100.04712.69
5.2.110.0000.07012.69
5.2.100.0030.06312.69
5.2.90.0030.04712.69
5.2.80.0030.03712.69
5.2.70.0100.06012.69
5.2.60.0000.04012.69
5.2.50.0030.05712.69
5.2.40.0030.06312.69
5.2.30.0100.05712.69
5.2.20.0100.04012.69
5.2.10.0030.05012.69
5.2.00.0100.02712.69
5.1.60.0000.03312.69
5.1.50.0100.02312.69
5.1.40.0000.04312.69
5.1.30.0030.05712.69
5.1.20.0070.04312.69
5.1.10.0100.04312.69
5.1.00.0030.05012.69
5.0.50.0070.04312.69
5.0.40.0030.04312.69
5.0.30.0030.07712.69
5.0.20.0030.02012.69
5.0.10.0000.02712.69
5.0.00.0100.03712.69
4.4.90.0070.01312.69
4.4.80.0000.03712.69
4.4.70.0000.03712.69
4.4.60.0000.03312.69
4.4.50.0000.04012.69
4.4.40.0000.05312.69
4.4.30.0000.03712.69
4.4.20.0000.03012.69
4.4.10.0030.03312.69
4.4.00.0000.05312.69
4.3.110.0070.01712.69
4.3.100.0000.04712.69
4.3.90.0000.03012.69
4.3.80.0000.03712.69
4.3.70.0030.03012.69
4.3.60.0070.02712.69
4.3.50.0000.02012.69
4.3.40.0000.04712.69
4.3.30.0000.03712.69
4.3.20.0030.02012.69
4.3.10.0030.03012.69
4.3.00.0000.03312.69

preferences:
42.94 ms | 401 KiB | 5 Q