3v4l.org

run code in 300+ PHP versions simultaneously
<?php function standard_date_format($str) { preg_match_all('/(\d{1,2}) (\w+) (\d{4})/', $str, $matches); foreach ($matches[1] as $day) { $days [] = $day; } foreach ($matches[2] as $month) { $months [] = $month; } foreach ($matches[3] as $year) { $years [] = $year; } $all_months = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); for ($i = sizeof($days) - 1; $i >= 0; $i --) { $month = array_search($months[$i], $all_months) + 1; $month = strlen($month) < 2 ? '0'.$month : $month; $results [] = $years[$i] . '-' . $month . '-' . $days[$i]; } return $results; } $str1 = "Company registered on 16 March 2003"; $str2 = "Activity between 10 May 2006 an 10 July 2008 - no changes."; print_r(standard_date_format($str1)); print_r(standard_date_format($str2));

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.130.0080.00018.51
8.3.120.0040.00418.99
8.3.110.0000.00920.94
8.3.100.0050.00318.70
8.3.90.0150.00016.78
8.3.80.0030.00718.43
8.3.70.0060.01016.63
8.3.60.0120.00916.73
8.3.50.0120.00622.11
8.3.40.0150.00018.95
8.3.30.0100.00319.00
8.3.20.0040.00420.24
8.3.10.0030.00521.85
8.3.00.0050.00320.76
8.2.250.0040.00418.93
8.2.240.0070.01118.97
8.2.230.0040.00422.58
8.2.220.0050.00524.06
8.2.210.0080.00026.77
8.2.200.0030.00616.63
8.2.190.0100.00616.88
8.2.180.0160.00025.92
8.2.170.0120.00319.05
8.2.160.0060.00822.96
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0000.00822.38
8.2.120.0080.00026.35
8.2.110.0060.00320.24
8.2.100.0030.00918.03
8.2.90.0000.00719.17
8.2.80.0050.00317.97
8.2.70.0040.00417.88
8.2.60.0040.00418.16
8.2.50.0030.00618.10
8.2.40.0080.00020.59
8.2.30.0070.00020.58
8.2.20.0040.00417.78
8.2.10.0000.00718.04
8.2.00.0000.00718.18
8.1.300.0090.00019.80
8.1.290.0060.00318.88
8.1.280.0120.00925.92
8.1.270.0080.00023.75
8.1.260.0080.00028.09
8.1.250.0040.00428.09
8.1.240.0040.00423.83
8.1.230.0060.00619.04
8.1.220.0000.00917.75
8.1.210.0000.00818.77
8.1.200.0000.00817.48
8.1.190.0060.00617.35
8.1.180.0060.00318.10
8.1.170.0040.00418.71
8.1.160.0030.00520.80
8.1.150.0000.00718.93
8.1.140.0050.00219.74
8.1.130.0050.00217.53
8.1.120.0040.00417.65
8.1.110.0000.00817.59
8.1.100.0070.00017.50
8.1.90.0000.00717.65
8.1.80.0000.00817.63
8.1.70.0070.00017.54
8.1.60.0060.00317.79
8.1.50.0030.00517.71
8.1.40.0040.00417.58
8.1.30.0030.00617.72
8.1.20.0020.00517.79
8.1.10.0000.00817.65
8.1.00.0050.00317.66
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0000.00818.48
8.0.270.0000.00717.03
8.0.260.0090.00016.98
8.0.250.0030.00317.12
8.0.240.0030.00317.08
8.0.230.0030.00617.11
8.0.220.0040.00416.95
8.0.210.0040.00417.03
8.0.200.0030.00317.11
8.0.190.0030.00517.12
8.0.180.0040.00417.04
8.0.170.0050.00217.06
8.0.160.0040.00417.09
8.0.150.0030.00316.90
8.0.140.0000.00717.05
8.0.130.0040.00613.44
8.0.120.0070.00515.24
8.0.110.0070.00415.20
8.0.100.0070.00515.15
8.0.90.0090.00315.28
8.0.80.0140.00615.20
8.0.70.0090.00315.20
8.0.60.0040.00815.19
8.0.50.0080.00415.28
8.0.30.0100.00815.74
8.0.20.0100.00816.49
8.0.10.0100.00215.32
8.0.00.0050.01316.10
7.4.330.0000.00615.08
7.4.320.0060.00016.84
7.4.300.0000.00716.79
7.4.290.0070.00016.71
7.4.280.0030.00516.81
7.4.270.0040.00416.75
7.4.260.0030.00415.04
7.4.250.0110.00415.10
7.4.240.0100.00415.12
7.4.230.0100.00415.08
7.4.220.0160.01015.14
7.4.210.0130.00315.14
7.4.200.0060.00615.08
7.4.190.0120.00413.50
7.4.180.0130.00513.62
7.4.160.0080.01015.06
7.4.150.0190.00115.47
7.4.140.0130.00516.44
7.4.130.0100.00615.70
7.4.120.0090.00815.67
7.4.110.0140.00415.15
7.4.100.0180.00215.20
7.4.90.0150.00515.17
7.4.80.0140.00416.45
7.4.70.0110.00615.11
7.4.60.0090.00714.91
7.4.50.0090.00515.10
7.4.40.0080.00815.07
7.4.30.0100.00615.12
7.4.20.0140.00313.38
7.4.10.0120.00413.36
7.4.00.0140.00314.29
7.3.330.0060.00513.39
7.3.320.0080.00313.46
7.3.310.0100.00315.02
7.3.300.0100.00314.97
7.3.290.0100.00615.78
7.3.280.0110.00815.72
7.3.270.0120.00615.38
7.3.260.0100.00614.91
7.3.250.0110.00515.76
7.3.240.0090.00915.48
7.3.230.0090.00815.05
7.3.220.0140.00513.43
7.3.210.0120.00414.91
7.3.200.0110.00614.82
7.3.190.0080.00915.04
7.3.180.0090.00914.84
7.3.170.0120.00415.01
7.3.160.0110.00514.88
7.3.150.0130.00313.21
7.3.140.0140.00313.27
7.3.130.0120.00013.42
7.3.120.0150.00313.39
7.3.110.0120.00513.13
7.3.100.0120.00613.21
7.3.90.0130.00614.40
7.3.80.0100.00614.09
7.3.70.0100.00514.34
7.3.60.0140.00114.12
7.3.50.0150.00314.29
7.3.40.0100.00814.28
7.3.30.0100.01014.31
7.3.20.0110.00914.35
7.3.10.0100.00515.11
7.3.00.0110.00715.04
7.2.340.0140.00313.61
7.2.330.0110.00615.26
7.2.320.0130.00415.26
7.2.310.0100.00715.25
7.2.300.0100.00715.20
7.2.290.0100.00715.22
7.2.280.0150.00313.66
7.2.270.0110.00713.51
7.2.260.0130.00813.52
7.2.250.0080.00813.49
7.2.240.0170.00013.66
7.2.230.0120.00613.48
7.2.220.0130.00614.38
7.2.210.0110.00814.29
7.2.200.0150.00514.46
7.2.190.0130.00714.44
7.2.180.0150.00514.46
7.2.170.0120.00614.60
7.2.160.0110.00914.62
7.2.150.0090.00814.36
7.2.140.0170.00214.53
7.2.130.0100.00815.26
7.2.120.0120.00715.23
7.2.110.0110.00315.16
7.2.100.0130.00615.31
7.2.90.0110.00615.38
7.2.80.0140.00515.23
7.2.70.0080.01015.26
7.2.60.0100.00815.77
7.2.50.0120.00815.24
7.2.40.0130.00715.48
7.2.30.0110.00815.29
7.2.20.0100.00815.31
7.2.10.0110.00715.28
7.2.00.0170.00516.52
7.1.330.0140.00312.68
7.1.320.0120.00713.38
7.1.310.0100.00813.43
7.1.300.0120.01014.32
7.1.290.0120.00714.34
7.1.280.0160.00714.27
7.1.270.0130.00714.06
7.1.260.0110.00714.27
7.1.250.0110.00614.55
7.1.240.0100.00914.17
7.1.230.0100.00614.38
7.1.220.0070.01314.24
7.1.210.0100.00814.13
7.1.200.0100.00414.87
7.1.190.0090.01014.36
7.1.180.0140.00314.27
7.1.170.0120.00614.22
7.1.160.0120.00714.16
7.1.150.0090.00914.31
7.1.140.0100.00614.24
7.1.130.0070.01014.31
7.1.120.0110.00514.32
7.1.110.0120.00514.38
7.1.100.0290.00714.99
7.1.90.0140.00614.41
7.1.80.0130.00314.51
7.1.70.0160.00515.35
7.1.60.0090.00715.99
7.1.50.0110.00514.33
7.1.40.0080.01014.43
7.1.30.0080.00914.29
7.1.20.0110.00514.38
7.1.10.0120.00514.38
7.1.00.0080.02817.06
7.0.330.0450.00813.87
7.0.320.0170.00513.86
7.0.310.0150.00714.07
7.0.300.0150.00514.06
7.0.290.0120.00813.98
7.0.280.0170.00514.02
7.0.270.0140.00513.98
7.0.260.0090.01114.10
7.0.250.0160.00114.13
7.0.240.0130.00714.17
7.0.230.0170.00514.18
7.0.220.0130.00814.07
7.0.210.0120.00614.12
7.0.200.0270.00414.23
7.0.190.0130.00914.00
7.0.180.0150.00414.12
7.0.170.0130.00614.08
7.0.160.0170.00514.07
7.0.150.0130.00914.08
7.0.140.0170.00614.04
7.0.130.0150.00314.09
7.0.120.0090.00914.14
7.0.110.0110.00814.07
7.0.100.0230.00514.05
7.0.90.0140.00514.00
7.0.80.0150.00514.06
7.0.70.0100.00713.90
7.0.60.0090.01716.65
7.0.50.0130.02715.28
7.0.40.0270.02016.20
7.0.30.0170.02616.15
7.0.20.0110.02916.17
7.0.10.0210.02516.02
7.0.00.0180.02416.09
5.6.400.0060.01113.93
5.6.390.0170.00113.62
5.6.380.0140.00513.79
5.6.370.0130.00613.47
5.6.360.0150.00613.57
5.6.350.0130.00713.63
5.6.340.0110.00713.78
5.6.330.0150.00613.67
5.6.320.0130.00713.60
5.6.310.0150.00313.58
5.6.300.0100.00813.54
5.6.290.0160.00413.69
5.6.280.0100.03016.21
5.6.270.0160.00513.78
5.6.260.0110.00813.71
5.6.250.0140.00613.55
5.6.240.0150.00413.82
5.6.230.0150.00613.75
5.6.220.0180.00013.63
5.6.210.0150.02616.05
5.6.200.0150.02715.36
5.6.190.0250.02416.04
5.6.180.0150.02716.06
5.6.170.0140.02216.08
5.6.160.0130.02516.09
5.6.150.0120.02716.06
5.6.140.0070.03115.94
5.6.130.0180.02415.99
5.6.120.0200.02416.00
5.6.110.0150.02215.93
5.6.100.0220.02315.92
5.6.90.0240.02315.90
5.6.80.0250.02715.63
5.6.70.0250.02315.75
5.6.60.0270.02215.82
5.6.50.0250.02715.65
5.6.40.0230.02615.81
5.6.30.0250.02115.75
5.6.20.0270.02415.62
5.6.10.0280.02715.63
5.6.00.0300.02015.68
5.5.380.0070.01113.87
5.5.370.0110.00513.90
5.5.360.0050.01113.57
5.5.350.0100.03215.84
5.5.340.0130.02615.04
5.5.330.0230.02515.88
5.5.320.0210.03615.74
5.5.310.0100.02516.02
5.5.300.0130.02415.77
5.5.290.0190.02315.83
5.5.280.0120.02315.85
5.5.270.0140.02515.84
5.5.260.0180.02615.80
5.5.250.0220.02315.93
5.5.240.0180.02615.66
5.5.230.0260.02715.62
5.5.220.0260.02115.49
5.5.210.0280.02715.65
5.5.200.0290.01915.51
5.5.190.0260.02315.49
5.5.180.0220.02615.71
5.5.170.0080.00813.79
5.5.160.0240.02415.57
5.5.150.0240.02615.55
5.5.140.0210.02115.51
5.5.130.0190.02415.49
5.5.120.0210.02515.56
5.5.110.0250.02215.56
5.5.100.0210.02315.46
5.5.90.0260.02515.60
5.5.80.0270.02015.61
5.5.70.0270.02515.49
5.5.60.0200.02515.54
5.5.50.0220.02215.48
5.5.40.0280.02615.50
5.5.30.0240.02915.47
5.5.20.0270.02115.53
5.5.10.0210.02315.60
5.5.00.0280.02215.52

preferences:
30.72 ms | 403 KiB | 5 Q