3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Returns the day name according to the current locale * * @param int $n The day number (ISO-8601 numeric representation) * @param string $lc The desired locale for the returned day name * * @return string The day name */ function day_name(int $n, string $lc = "en_GB") { // Store the current locale so that we can reset it $olc = setlocale(LC_TIME, "0"); // Set the locale according to the $locale passed in setlocale(LC_TIME, $lc); // Get the day name according to the $locale passed in $output = strftime("%A", strtotime("Last Sunday +{$n} days")); // Reset the locale setLocale(LC_TIME, $olc); // Return the day name return $output; } echo day_name(4, "fr_FR");

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.3.40.0030.01319.22
8.3.30.0090.00519.13
8.3.20.0040.00422.10
8.3.10.0030.00524.02
8.3.00.0030.00520.06
8.2.170.0070.00722.96
8.2.160.0070.00722.58
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0000.00719.77
8.2.120.0000.00726.35
8.2.110.0100.00021.57
8.2.100.0080.00318.47
8.2.90.0040.00418.47
8.2.80.0030.00519.68
8.2.70.0080.00018.42
8.2.60.0050.00318.43
8.2.50.0080.00318.59
8.2.40.0100.00020.94
8.2.30.0110.00019.94
8.2.20.0080.00418.46
8.2.10.0050.00518.43
8.2.00.0000.00918.61
8.1.270.0040.00424.33
8.1.260.0060.00326.35
8.1.250.0030.00528.09
8.1.240.0070.00322.98
8.1.230.0100.00021.41
8.1.220.0040.00418.16
8.1.210.0000.01119.16
8.1.200.0000.00817.98
8.1.190.0120.00017.85
8.1.180.0030.00618.10
8.1.170.0080.00019.21
8.1.160.0080.00019.31
8.1.150.0000.00719.55
8.1.140.0090.00018.15
8.1.130.0070.00319.57
8.1.120.0000.01017.87
8.1.110.0090.00317.95
8.1.100.0140.00017.99
8.1.90.0090.00217.95
8.1.80.0000.00817.95
8.1.70.0090.00617.96
8.1.60.0140.00217.91
8.1.50.0070.00718.01
8.1.40.0070.00717.99
8.1.30.0120.00218.16
8.1.20.0120.00618.11
8.1.10.0050.00518.06
8.1.00.0080.00818.04
8.0.300.0050.00220.50
8.0.290.0030.00517.38
8.0.280.0100.00418.97
8.0.270.0030.00517.83
8.0.260.0030.00617.74
8.0.250.0070.00017.45
8.0.240.0070.00417.46
8.0.230.0070.00017.61
8.0.220.0120.00017.49
8.0.210.0080.00317.38
8.0.200.0000.00717.57
8.0.190.0000.00717.48
8.0.180.0000.01117.43
8.0.170.0110.00017.49
8.0.160.0130.00417.50
8.0.150.0070.00717.51
8.0.140.0000.00817.54
8.0.130.0160.00013.67
8.0.120.0000.00817.32
8.0.110.0000.00717.38
8.0.100.0020.00517.45
8.0.90.0000.00717.37
8.0.80.0100.00717.40
8.0.70.0040.00417.44
8.0.60.0040.00417.29
8.0.50.0000.00817.53
8.0.30.0110.01017.70
8.0.20.0250.00617.71
8.0.10.0060.00317.46
8.0.00.0090.01317.34
7.4.330.0050.00015.55
7.4.320.0080.00016.89
7.4.300.0030.00317.06
7.4.290.0120.00316.98
7.4.280.0080.00817.03
7.4.270.0080.00517.10
7.4.260.0000.00817.09
7.4.250.0000.00816.90
7.4.240.0040.00417.07
7.4.230.0000.00717.01
7.4.220.0000.00817.00
7.4.210.0060.00917.15
7.4.200.0050.00216.81
7.4.160.0130.00617.07
7.4.140.0150.00817.86
7.4.130.0220.00616.95
7.4.120.0150.00917.04
7.4.110.0170.00917.03
7.4.100.0210.00617.11
7.4.90.0180.00916.94
7.4.80.0140.01419.39
7.4.70.0210.00917.05
7.4.60.0140.01017.08
7.4.50.0040.01416.94
7.4.40.0240.00817.39
7.4.10.0060.01215.22
7.4.00.0070.01115.43
7.3.330.0070.00413.72
7.3.320.0080.00413.70
7.3.310.0030.00316.83
7.3.300.0000.00716.80
7.3.290.0070.00016.81
7.3.280.0160.01016.85
7.3.260.0160.01216.96
7.3.240.0190.00817.06
7.3.230.0090.00817.09
7.3.210.0070.01817.11
7.3.200.0070.01016.79
7.3.190.0080.00817.23
7.3.180.0070.01016.82
7.3.170.0170.00816.80
7.3.160.0100.00716.95
7.3.130.0070.01315.27
7.3.120.0090.00914.99
7.3.110.0110.00615.34
7.3.100.0060.00914.98
7.3.90.0070.00714.99
7.3.80.0030.01015.06
7.3.70.0080.00614.80
7.3.60.0100.00315.01
7.3.50.0040.00415.22
7.3.40.0040.01115.15
7.3.30.0000.01515.10
7.3.20.0100.00717.02
7.3.10.0090.00516.92
7.3.00.0080.00216.96
7.2.330.0090.00916.85
7.2.320.0160.00617.16
7.2.310.0080.02117.32
7.2.300.0200.00917.29
7.2.290.0120.00817.34
7.2.260.0060.01215.47
7.2.250.0130.00915.25
7.2.240.0090.00615.08
7.2.230.0080.00814.87
7.2.220.0030.01115.44
7.2.210.0090.00315.11
7.2.200.0040.00815.09
7.2.190.0070.01015.16
7.2.180.0070.00415.27
7.2.170.0070.00715.24
7.2.160.0090.00015.18
7.2.150.0040.01517.10
7.2.140.0100.00716.79
7.2.130.0050.00816.97
7.2.120.0120.00317.01
7.2.110.0050.01116.96
7.2.100.0120.00517.00
7.2.90.0070.00917.21
7.2.80.0060.01017.09
7.2.70.0060.00616.92
7.2.60.0060.00717.09
7.2.50.0030.01217.24
7.2.40.0320.01117.53
7.2.30.0080.00817.49
7.2.20.0310.01117.40
7.2.10.0060.00917.40
7.2.00.0130.00917.53
7.1.330.0030.01015.99
7.1.320.0050.00416.14
7.1.310.0030.01016.20
7.1.300.0070.00715.79
7.1.290.0060.00315.68
7.1.280.0000.01515.95
7.1.270.0100.00716.14
7.1.260.0100.00716.10
7.1.250.0050.00715.88
7.1.240.0100.00615.88
7.1.230.0030.01115.78
7.1.220.0060.00315.97
7.1.210.0000.01316.10
7.1.200.0110.00616.11
7.1.190.0050.00516.09
7.1.180.0080.00316.03
7.1.170.0120.00316.00
7.1.160.0550.00916.57
7.1.150.0040.01016.63
7.1.140.0100.00616.46
7.1.130.0050.01216.49
7.1.120.0100.00616.59
7.1.110.0420.01016.19
7.1.100.0090.00616.23
7.1.90.0380.01316.07
7.1.80.0380.01116.38
7.1.70.0540.01115.85
7.1.60.0430.00924.47
7.1.50.0480.00524.40
7.1.40.0160.01024.28
7.1.30.0170.00924.32
7.1.20.0280.01424.47
7.1.10.0400.00915.53
7.1.00.0850.00615.55
7.0.330.0060.00915.69
7.0.320.0060.00615.70
7.0.310.0060.01015.32
7.0.300.0080.00615.54
7.0.290.0030.01115.55
7.0.280.0070.00315.63
7.0.270.0030.01315.51
7.0.260.0060.01215.66
7.0.250.0000.01115.82
7.0.240.0000.01015.73
7.0.230.0030.01015.80
7.0.220.0000.00915.61
7.0.210.0000.00915.38
7.0.200.0080.00415.59
7.0.190.0110.00315.53
7.0.180.0050.00515.58
7.0.170.0030.00615.61
7.0.160.0030.01015.74
7.0.150.0030.00915.69
7.0.140.0070.00715.64
7.0.130.0040.00815.58
7.0.120.0030.01015.50
7.0.110.0000.01315.69
7.0.100.0040.00415.66
7.0.90.0090.00915.54
7.0.80.0060.00915.67
7.0.70.0000.01215.36
7.0.60.0070.00715.68
7.0.50.0030.01015.73
7.0.40.0120.00013.54
7.0.30.0040.01213.86
7.0.20.0070.00313.62
7.0.10.0070.00713.82
7.0.00.0000.01513.27
5.6.400.0040.00814.31
5.6.390.0070.01013.93
5.6.380.0060.00613.79
5.6.370.0000.00914.52
5.6.360.0100.00314.07
5.6.350.0060.00614.41
5.6.340.0030.01014.40
5.6.330.0040.01214.29
5.6.320.0000.01414.16
5.6.310.0060.00314.27
5.6.300.0070.00713.80
5.6.290.0040.00814.20
5.6.280.0060.00614.18
5.6.270.0070.00714.04
5.6.260.0030.01014.04
5.6.250.0040.00814.17
5.6.240.0150.00013.99
5.6.230.0000.01614.38
5.6.220.0060.01014.26
5.6.210.0090.00614.02
5.6.200.0030.01114.34
5.6.190.0030.01014.31
5.6.180.0080.00814.01
5.6.170.0040.01113.97
5.6.160.0000.01013.76
5.6.150.0110.00413.73
5.6.140.0100.00613.94
5.6.130.0080.00314.07
5.6.120.0070.00414.06
5.6.110.0060.00614.14
5.6.100.0080.00014.02
5.6.90.0070.00714.23
5.6.80.0000.01313.88
5.6.70.0090.00013.81
5.6.60.0070.00714.11
5.6.50.0040.00414.16
5.6.40.0030.00913.92
5.6.30.0040.00814.04
5.6.20.0030.00713.90
5.6.10.0000.01113.94
5.6.00.0030.00514.12

preferences:
62.64 ms | 400 KiB | 5 Q