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 date($format, time()); echo '<br>'.date('Y-m-d 00:00:00', time());

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.0060.01315.09
7.3.120.0080.00915.04
7.3.110.0040.01415.01
7.3.100.0070.01014.97
7.3.90.0080.00414.79
7.3.80.0060.00914.69
7.3.70.0060.00914.92
7.3.60.0040.01514.98
7.3.50.0030.01214.88
7.3.40.0070.00714.71
7.3.30.0090.00614.74
7.3.20.0040.01116.72
7.3.10.0090.00916.48
7.3.00.0060.01216.79
7.2.250.0060.00914.86
7.2.240.0090.00915.29
7.2.230.0100.00314.96
7.2.220.0030.01014.66
7.2.210.0000.01515.05
7.2.200.0100.00314.91
7.2.190.0130.00314.90
7.2.180.0050.00514.94
7.2.170.0070.00715.08
7.2.00.0070.00719.37
7.1.330.0070.00715.95
7.1.320.0030.00615.86
7.1.310.0040.01115.68
7.1.300.0000.01615.77
7.1.290.0030.01015.88
7.1.280.0060.00615.86
7.1.270.0080.00615.52
7.1.260.0090.00615.79
7.1.100.0060.00917.87
7.1.70.0000.00717.28
7.1.60.0110.01419.40
7.1.50.0100.01316.90
7.1.00.0000.03722.57
7.0.200.0130.00516.82
7.0.140.0030.07021.97
7.0.120.0000.07722.19
7.0.100.0000.04020.18
7.0.90.0230.03319.96
7.0.80.0270.08319.88
7.0.70.0100.08319.96
7.0.60.0230.08319.93
7.0.50.0300.05720.27
7.0.40.0070.08320.08
7.0.30.0070.05720.18
7.0.20.0070.07720.07
7.0.10.0000.05020.03
7.0.00.0030.04320.14
5.6.280.0030.07320.76
5.6.250.0030.04020.59
5.6.240.0130.04020.60
5.6.230.0070.03720.57
5.6.220.0130.06320.49
5.6.210.0100.03720.47
5.6.200.0070.07321.12
5.6.190.0070.08021.10
5.6.180.0070.07321.17
5.6.170.0100.07720.95
5.6.160.0030.05321.08
5.6.150.0070.05321.05
5.6.140.0130.08020.95
5.6.130.0000.07321.05
5.6.120.0070.04721.02
5.6.110.0070.04721.10
5.6.100.0170.08021.11
5.6.90.0030.05720.92
5.6.80.0100.07720.42
5.6.70.0070.07020.32
5.6.60.0100.05020.46
5.6.50.0070.08320.43
5.6.40.0130.07720.45
5.6.30.0100.08020.38
5.6.20.0100.04320.37
5.6.10.0170.07020.40
5.6.00.0000.06020.51
5.5.380.0070.03020.42
5.5.370.0030.04020.41
5.5.360.0000.05020.39
5.5.350.0030.05020.42
5.5.340.0030.08020.87
5.5.330.0030.07320.83
5.5.320.0100.07320.93
5.5.310.0030.06020.78
5.5.300.0130.04720.88
5.5.290.0070.04720.90
5.5.280.0030.08720.86
5.5.270.0100.08320.92
5.5.260.0100.08720.92
5.5.250.0100.06020.68
5.5.240.0130.05320.13
5.5.230.0170.07720.27
5.5.220.0070.04020.27
5.5.210.0130.04720.14
5.5.200.0130.04020.24
5.5.190.0070.05020.27
5.5.180.0100.08020.23
5.5.160.0070.06320.18
5.5.150.0170.06720.19
5.5.140.0070.04319.99
5.5.130.0030.05320.16
5.5.120.0100.05720.27
5.5.110.0170.06019.99
5.5.100.0070.04720.12
5.5.90.0100.07320.18
5.5.80.0170.03320.10
5.5.70.0030.08020.10
5.5.60.0070.04320.16
5.5.50.0130.05020.11
5.5.40.0100.05320.06
5.5.30.0100.04020.06
5.5.20.0030.06720.11
5.5.10.0030.08019.97
5.5.00.0030.08020.11
5.4.450.0000.05019.47
5.4.440.0070.04319.36
5.4.430.0100.07319.37
5.4.420.0100.07319.50
5.4.410.0030.07319.06
5.4.400.0100.06719.05
5.4.390.0130.05718.88
5.4.380.0130.04719.23
5.4.370.0030.04319.18
5.4.360.0070.06318.94
5.4.350.0070.07719.11
5.4.340.0030.06719.04
5.4.320.0070.04019.05
5.4.310.0070.05319.05
5.4.300.0100.07719.20
5.4.290.0200.04719.12
5.4.280.0130.07319.21
5.4.270.0030.08019.02
5.4.260.0100.04719.13
5.4.250.0030.04319.20
5.4.240.0130.03719.13
5.4.230.0030.06019.15
5.4.220.0030.07719.12
5.4.210.0100.03718.86
5.4.200.0070.05719.12
5.4.190.0130.07019.16
5.4.180.0100.06719.02
5.4.170.0030.04719.17
5.4.160.0070.06019.07
5.4.150.0100.04319.01
5.4.140.0100.07316.43
5.4.130.0100.07016.32
5.4.120.0030.05016.49
5.4.110.0030.05316.39
5.4.100.0100.06316.46
5.4.90.0000.07016.47
5.4.80.0100.06716.34
5.4.70.0070.03016.50
5.4.60.0000.04716.45
5.4.50.0000.05716.41
5.4.40.0030.05316.53
5.4.30.0030.03716.41
5.4.20.0130.03016.35
5.4.10.0030.04016.40
5.4.00.0100.06715.88
5.3.290.0070.07314.75
5.3.280.0070.08314.57
5.3.270.0070.07714.62
5.3.260.0070.07014.58
5.3.250.0030.06314.63
5.3.240.0000.04714.57
5.3.230.0030.05314.70
5.3.220.0000.04714.70
5.3.210.0070.06314.67
5.3.200.0070.06314.65
5.3.190.0030.04014.66
5.3.180.0000.03714.67
5.3.170.0070.07314.66
5.3.160.0070.04314.65
5.3.150.0070.08714.53
5.3.140.0070.07314.61
5.3.130.0030.04314.53
5.3.120.0070.07314.48
5.3.110.0030.05314.57
5.3.100.0030.03714.18
5.3.90.0030.03714.03
5.3.80.0030.04714.08
5.3.70.0130.06314.11
5.3.60.0100.06713.93
5.3.50.0070.03713.88
5.3.40.0070.03314.05
5.3.30.0130.05013.95
5.3.20.0100.06013.77
5.3.10.0100.03013.63
5.3.00.0070.03013.62
5.2.170.0070.04311.00
5.2.160.0000.04311.20
5.2.150.0070.05311.15
5.2.140.0030.04311.20
5.2.130.0030.03011.16
5.2.120.0100.05711.03
5.2.110.0100.05711.01
5.2.100.0000.04011.01
5.2.90.0070.05711.18
5.2.80.0030.05711.11
5.2.70.0130.06011.15
5.2.60.0100.05711.11
5.2.50.0070.06011.08
5.2.40.0000.02710.99
5.2.30.0070.05711.03
5.2.20.0070.02310.89
5.2.10.0070.04710.85
5.2.00.0070.05310.77
5.1.60.0070.04010.07
5.1.50.0070.04010.06
5.1.40.0070.0339.86
5.1.30.0000.03010.20
5.1.20.0100.06010.40
5.1.10.0070.02010.16
5.1.00.0070.02010.18
5.0.50.0030.0339.11
5.0.40.0070.0279.11
5.0.30.0070.0479.11
5.0.20.0030.0439.11
5.0.10.0030.0409.11
5.0.00.0070.0239.11
4.4.90.0000.0139.11
4.4.80.0000.0279.11
4.4.70.0000.0279.11
4.4.60.0000.0279.11
4.4.50.0000.0239.11
4.4.40.0000.0439.11
4.4.30.0000.0379.11
4.4.20.0030.0139.11
4.4.10.0000.0179.11
4.4.00.0030.0339.11
4.3.110.0030.0179.11
4.3.100.0030.0339.11
4.3.90.0000.0209.11
4.3.80.0030.0279.11
4.3.70.0030.0139.11
4.3.60.0030.0109.11
4.3.50.0000.0139.11
4.3.40.0000.0379.11
4.3.30.0030.0109.11
4.3.20.0030.0139.11
4.3.10.0030.0139.11
4.3.00.0000.0209.11

preferences:
37.37 ms | 401 KiB | 5 Q