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', 'past', false);

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.10.0090.00316.72
7.3.00.0090.00316.45
7.2.130.0070.00716.93
7.2.120.0000.01417.12
7.2.110.0040.01116.81
7.2.100.0000.01716.96
7.2.90.0110.00417.18
7.2.80.0080.01216.63
7.2.70.0130.00317.05
7.2.60.0070.01016.75
7.2.50.0080.01117.22
7.2.40.0060.01217.20
7.2.30.0080.01216.59
7.2.20.0030.01417.30
7.2.10.0100.00516.86
7.2.00.0070.00718.22
7.1.250.0050.00515.86
7.1.100.0080.00418.00
7.1.70.0030.00717.34
7.1.60.0090.00417.57
7.1.50.0030.01717.17
7.1.00.0030.03322.26
7.0.200.0000.01717.04
7.0.140.0000.07722.19
7.0.120.0030.07722.05
7.0.80.0670.07719.86
7.0.70.0730.07319.86
7.0.60.0670.07319.93
7.0.50.0100.04720.38
7.0.40.0070.08020.11
7.0.30.0070.07019.96
7.0.20.0130.05720.06
7.0.10.0070.08020.05
7.0.00.0100.04020.09
5.6.280.0000.09721.09
5.6.230.0130.08020.53
5.6.220.0100.07020.65
5.6.210.0000.05720.62
5.6.200.0100.08021.07
5.6.190.0000.06321.04
5.6.180.0300.05721.03
5.6.170.0000.08721.11
5.6.160.0100.03721.08
5.6.150.0130.06321.01
5.6.140.0000.09021.05
5.6.130.0130.06021.17
5.6.120.0070.08020.95
5.6.110.0130.07721.05
5.6.100.0030.07321.06
5.6.90.0200.06720.99
5.6.80.0100.07320.34
5.6.70.0100.08020.31
5.6.60.0030.05020.46
5.6.50.0100.07720.50
5.6.40.0070.05720.32
5.6.30.0130.07720.44
5.6.20.0070.08020.43
5.6.10.0070.08020.47
5.6.00.0100.05720.45
5.5.370.0030.04320.55
5.5.360.0030.07020.39
5.5.350.0030.05720.46
5.5.340.0070.07320.90
5.5.330.0070.04320.65
5.5.320.0070.07720.93
5.5.310.0070.05020.85
5.5.300.0070.08320.80
5.5.290.0070.09020.80
5.5.280.0100.07020.80
5.5.270.0100.04720.89
5.5.260.0100.08320.87
5.5.250.0130.08320.57
5.5.240.0170.07320.30
5.5.230.0100.08320.11
5.5.220.0130.07020.16
5.5.210.0030.08020.28
5.5.200.0230.06320.30
5.5.190.0070.07720.24
5.5.180.0170.07720.28
5.5.160.0030.06020.23
5.5.150.0030.08020.28
5.5.140.0030.08020.23
5.5.130.0200.06320.22
5.5.120.0100.07719.99
5.5.110.0100.04320.18
5.5.100.0100.07720.10
5.5.90.0070.04719.97
5.5.80.0030.07720.04
5.5.70.0070.05720.16
5.5.60.0070.03720.05
5.5.50.0000.04320.05
5.5.40.0070.04019.93
5.5.30.0130.03720.14
5.5.20.0030.05320.06
5.5.10.0000.04320.05
5.5.00.0100.04020.05
5.4.450.0030.05319.36
5.4.440.0100.06719.45
5.4.430.0130.07319.41
5.4.420.0130.07319.46
5.4.410.0170.06019.28
5.4.400.0130.07719.21
5.4.390.0030.06319.12
5.4.380.0030.07318.85
5.4.370.0030.07719.04
5.4.360.0070.07319.25
5.4.350.0030.08019.09
5.4.340.0100.07719.14
5.4.320.0170.06718.91
5.4.310.0100.07719.05
5.4.300.0030.04319.25
5.4.290.0100.03719.09
5.4.280.0100.07319.15
5.4.270.0100.05019.22
5.4.260.0100.07719.04
5.4.250.0100.07719.09
5.4.240.0130.03719.15
5.4.230.0230.02319.04
5.4.220.0000.04319.22
5.4.210.0030.04019.02
5.4.200.0030.03718.95
5.4.190.0030.03718.83
5.4.180.0070.03319.11
5.4.170.0100.03319.15
5.4.160.0000.04319.02
5.4.150.0030.04019.02
5.4.140.0070.05016.48
5.4.130.0100.06316.24
5.4.120.0130.05016.45
5.4.110.0070.07716.36
5.4.100.0070.03316.29
5.4.90.0100.05016.38
5.4.80.0000.07016.43
5.4.70.0000.04016.42
5.4.60.0070.03316.43
5.4.50.0070.04016.48
5.4.40.0000.04016.36
5.4.30.0000.04716.45
5.4.20.0100.03016.30
5.4.10.0030.03716.33
5.4.00.0030.03715.87
5.3.290.0100.07314.63
5.3.280.0000.04014.61
5.3.270.0030.04314.67
5.3.260.0230.02714.61
5.3.250.0000.04014.66
5.3.240.0070.07314.58
5.3.230.0030.07714.73
5.3.220.0030.08314.66
5.3.210.0100.07314.55
5.3.200.0070.05714.53
5.3.190.0000.04314.57
5.3.180.0070.03314.68
5.3.170.0070.04014.53
5.3.160.0070.03714.51
5.3.150.0030.03714.68
5.3.140.0000.04014.52
5.3.130.0030.05014.52
5.3.120.0070.06014.48
5.3.110.0030.03714.61
5.3.100.0170.02714.04
5.3.90.0030.03713.95
5.3.80.0070.03314.03
5.3.70.0070.04014.00
5.3.60.0030.03714.03
5.3.50.0100.03014.00
5.3.40.0030.03713.94
5.3.30.0030.03013.96
5.3.20.0030.03313.75
5.3.10.0000.03013.71
5.3.00.0030.03013.54
5.2.170.0070.02711.05
5.2.160.0030.02711.21
5.2.150.0030.02711.20
5.2.140.0000.03011.27
5.2.130.0000.05011.02
5.2.120.0000.02711.18
5.2.110.0070.03011.02
5.2.100.0030.02711.21
5.2.90.0030.02711.16
5.2.80.0030.03311.12
5.2.70.0130.04011.08
5.2.60.0030.03011.16
5.2.50.0000.03011.14
5.2.40.0030.02311.06
5.2.30.0170.04011.02
5.2.20.0000.03010.88
5.2.10.0100.03710.87
5.2.00.0000.03010.74
5.1.60.0070.0479.84
5.1.50.0000.02710.06
5.1.40.0030.02310.00
5.1.30.0030.02010.25
5.1.20.0070.02010.40
5.1.10.0000.02310.15
5.1.00.0070.02010.13
5.0.50.0000.0179.59
5.0.40.0030.0439.59
5.0.30.0000.0309.59
5.0.20.0030.0209.59
5.0.10.0030.0409.59
5.0.00.0030.0539.59
4.4.90.0000.0279.59
4.4.80.0000.0179.59
4.4.70.0000.0139.59
4.4.60.0000.0179.59
4.4.50.0030.0139.59
4.4.40.0070.0279.59
4.4.30.0030.0139.59
4.4.20.0000.0209.59
4.4.10.0030.0279.59
4.4.00.0030.0179.59
4.3.110.0000.0179.59
4.3.100.0030.0139.59
4.3.90.0030.0109.59
4.3.80.0030.0539.59
4.3.70.0030.0309.59
4.3.60.0100.0309.59
4.3.50.0000.0339.59
4.3.40.0070.0509.59
4.3.30.0000.0379.59
4.3.20.0030.0379.59
4.3.10.0070.0239.59
4.3.00.0030.0239.59

preferences:
33.33 ms | 400 KiB | 5 Q