3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filename1 = "[Study] - Walton, Charles E 01-02-2012.txt"; $filename2 = "[Rx] - 01-02-2003 - Walton, Charles E.pdf"; function validate_date($filename) { preg_match("/(.*)(\d+-\d+-\d+)(.*)/",trim($filename),$matches); $date_arr = explode("-",$matches[2]); $month = str_pad($matches[0], 2, '0', STR_PAD_LEFT); $day = str_pad($matches[1], 2, '0', STR_PAD_LEFT); $year = $matches[2]; if ($year < 100) { if ($year > date("Y")+10) $year = $year + 1900; else $year = $year + 2000; } $date = $month . "-" . $day . "-" . $year; $filename = $matches[1] . $date . $matches[3]; return $matches[1]; } echo validate_date($filename1);

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.70.0120.00616.97
8.3.60.0090.00918.68
8.3.50.0110.01122.08
8.3.40.0070.01419.04
8.3.30.0150.00419.01
8.3.20.0030.00520.29
8.3.10.0000.00823.65
8.3.00.0000.00819.50
8.2.180.0040.01118.91
8.2.170.0040.01122.96
8.2.160.0070.00719.16
8.2.150.0000.01524.18
8.2.140.0000.00724.66
8.2.130.0080.00026.16
8.2.120.0000.01220.48
8.2.110.0040.00420.35
8.2.100.0090.00318.34
8.2.90.0080.00019.17
8.2.80.0040.00417.97
8.2.70.0000.00817.88
8.2.60.0030.00518.14
8.2.50.0040.00418.07
8.2.40.0090.00020.20
8.2.30.0040.00418.11
8.2.20.0000.00817.95
8.2.10.0080.00018.13
8.2.00.0040.00417.98
8.1.280.0150.00625.92
8.1.270.0090.00022.05
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.92
8.1.230.0110.00018.99
8.1.220.0000.00817.78
8.1.210.0030.00518.77
8.1.200.0070.00317.50
8.1.190.0030.00517.47
8.1.180.0000.00818.10
8.1.170.0040.00418.88
8.1.160.0000.00722.06
8.1.150.0080.00019.05
8.1.140.0070.00017.80
8.1.130.0070.00017.86
8.1.120.0000.00717.73
8.1.110.0030.00617.63
8.1.100.0040.00417.75
8.1.90.0040.00417.64
8.1.80.0050.00317.74
8.1.70.0000.00717.68
8.1.60.0030.00617.73
8.1.50.0030.00617.79
8.1.40.0000.00717.73
8.1.30.0030.00517.80
8.1.20.0030.00517.91
8.1.10.0000.00817.79
8.1.00.0080.00017.73
8.0.300.0050.00318.77
8.0.290.0060.00317.13
8.0.280.0000.00718.46
8.0.270.0020.00517.43
8.0.260.0030.00317.28
8.0.250.0030.00317.27
8.0.240.0000.00917.31
8.0.230.0000.00717.26
8.0.220.0000.00717.19
8.0.210.0030.00317.27
8.0.200.0030.00317.18
8.0.190.0030.00517.18
8.0.180.0050.00217.10
8.0.170.0040.00417.19
8.0.160.0040.00317.26
8.0.150.0030.00317.04
8.0.140.0000.00817.15
8.0.130.0030.00313.54
8.0.120.0070.00017.01
8.0.110.0050.00317.23
8.0.100.0000.00817.00
8.0.90.0030.00517.18
8.0.80.0100.01317.11
8.0.70.0030.00517.22
8.0.60.0040.00417.22
8.0.50.0000.00717.10
8.0.30.0120.01117.30
8.0.20.0080.01517.40
8.0.10.0000.00717.25
8.0.00.0140.00617.05
7.4.330.0050.00015.00
7.4.320.0030.00316.91
7.4.300.0030.00316.78
7.4.290.0030.00316.88
7.4.280.0060.00616.68
7.4.270.0000.00716.93
7.4.260.0030.00316.74
7.4.250.0050.00316.91
7.4.240.0050.00216.82
7.4.230.0060.00316.71
7.4.220.0100.00716.86
7.4.210.0070.00717.00
7.4.200.0000.00716.82
7.4.160.0100.00716.93
7.4.150.0130.00717.40
7.4.140.0110.01017.86
7.4.130.0090.00916.92
7.4.120.0050.01216.88
7.4.110.0110.00816.98
7.4.100.0060.01316.75
7.4.90.0050.01116.89
7.4.80.0110.00719.39
7.4.70.0130.00316.79
7.4.60.0140.00316.80
7.4.50.0000.00816.66
7.4.40.0080.00916.80
7.4.30.0030.01216.73
7.4.00.0000.01515.22
7.3.330.0050.00013.50
7.3.320.0000.00513.38
7.3.310.0050.00216.55
7.3.300.0070.00016.65
7.3.290.0090.00616.54
7.3.280.0100.00516.57
7.3.270.0000.01717.40
7.3.260.0090.00916.70
7.3.250.0080.00916.77
7.3.240.0120.01416.96
7.3.230.0030.01317.08
7.3.210.0070.01116.84
7.3.200.0120.00919.39
7.3.190.0100.01216.99
7.3.180.0090.00616.92
7.3.170.0140.00416.77
7.3.160.0100.00616.80
7.3.120.0110.00415.23
7.3.110.0030.01014.86
7.3.100.0030.00815.38
7.3.90.0070.01014.96
7.3.80.0100.00715.00
7.3.70.0000.01615.30
7.3.60.0120.00415.03
7.3.50.0030.01414.78
7.3.40.0090.00614.83
7.3.30.0060.00915.29
7.3.20.0040.01116.82
7.3.10.0130.00317.21
7.3.00.0110.00717.11
7.2.330.0080.00916.84
7.2.320.0080.00816.99
7.2.310.0100.00717.10
7.2.300.0080.00817.05
7.2.290.0090.00916.99
7.2.240.0070.00715.19
7.2.230.0000.01515.32
7.2.220.0070.00715.07
7.2.210.0110.00415.59
7.2.200.0070.00715.04
7.2.190.0040.01215.42
7.2.180.0130.00315.43
7.2.170.0070.01015.20
7.2.160.0110.00415.32
7.2.150.0070.00717.16
7.2.140.0130.00317.30
7.2.130.0070.00717.32
7.2.120.0070.01017.29
7.2.110.0090.00917.14
7.2.100.0070.01117.36
7.2.90.0090.00617.21
7.2.80.0090.00617.08
7.2.70.0040.00717.44
7.2.60.0070.00817.29
7.2.50.0070.01117.29
7.2.40.0090.00617.29
7.2.30.0030.00917.05
7.2.20.0160.00017.18
7.2.10.0090.00617.04
7.2.00.0030.01018.45
7.1.330.0130.00316.14
7.1.320.0030.01316.21
7.1.310.0090.00016.09
7.1.300.0100.00316.16
7.1.290.0060.01016.06
7.1.280.0060.00615.81
7.1.270.0000.01515.94
7.1.260.0070.00316.07
7.1.250.0070.00715.95
7.1.200.0000.00916.11
7.1.100.0040.00818.36
7.1.70.0000.00717.48
7.1.60.0160.00919.32
7.1.50.0060.01917.35
7.1.00.0000.07722.29
7.0.200.0040.00417.13
7.0.140.0000.08021.98
7.0.100.0030.04021.74
7.0.90.0070.08321.68
7.0.80.0070.05721.68
7.0.70.0030.04721.72
7.0.60.0070.07721.73
7.0.50.0070.07722.06
7.0.40.0070.06320.14
7.0.30.0100.04320.14
7.0.20.0070.07720.10
7.0.10.0000.07020.12
7.0.00.0170.07720.14
5.6.280.0030.07321.08
5.6.250.0100.06720.57
5.6.240.0070.07320.50
5.6.230.0100.07720.63
5.6.220.0030.07720.66
5.6.210.0070.07320.47
5.6.200.0100.04720.97
5.6.190.0070.08320.95
5.6.180.0070.07320.96
5.6.170.0030.06021.14
5.6.160.0030.08021.01
5.6.150.0070.08021.02
5.6.140.0000.08021.04
5.6.130.0100.07021.04
5.6.120.0070.08320.93
5.6.110.0000.08320.95
5.6.100.0130.08321.01
5.6.90.0030.05021.03
5.6.80.0030.04720.41
5.6.70.0030.08020.42
5.6.60.0070.07320.46
5.6.50.0070.04320.52
5.6.40.0030.06020.44
5.6.30.0070.07720.46
5.6.20.0030.05320.30
5.6.10.0070.07720.39
5.6.00.0070.07320.36
5.5.380.0030.08320.55
5.5.370.0230.05720.43
5.5.360.0070.07320.44
5.5.350.0000.08020.40
5.5.340.0000.05020.93
5.5.330.0170.07320.77
5.5.320.0100.06320.91
5.5.310.0000.04320.80
5.5.300.0070.04720.92
5.5.290.0030.05320.92
5.5.280.0000.08720.93
5.5.270.0070.07320.88
5.5.260.0070.07020.72
5.5.250.0100.07320.61
5.5.240.0030.04020.31
5.5.230.0100.07720.25
5.5.220.0000.05320.14
5.5.210.0130.06720.19
5.5.200.0070.05020.22
5.5.190.0070.07720.18
5.5.180.0000.05720.08
5.5.160.0070.07720.27
5.5.150.0070.07320.21
5.5.140.0070.07320.22
5.5.130.0100.05320.13
5.5.120.0030.04720.13
5.5.110.0070.06720.15
5.5.100.0130.05720.18
5.5.90.0030.07320.05
5.5.80.0030.04320.16
5.5.70.0030.07720.04
5.5.60.0030.07320.11
5.5.50.0070.07319.95
5.5.40.0030.06320.10
5.5.30.0030.07719.97
5.5.20.0070.04720.06
5.5.10.0070.05720.09
5.5.00.0100.05320.06
5.4.450.0030.08319.49
5.4.440.0070.04319.18
5.4.430.0000.05719.46
5.4.420.0070.07319.35
5.4.410.0100.03719.23
5.4.400.0000.08319.13
5.4.390.0000.08018.82
5.4.380.0070.07319.23
5.4.370.0030.04318.84
5.4.360.0100.06719.18
5.4.350.0030.08019.15
5.4.340.0130.06319.14
5.4.320.0030.08319.03
5.4.310.0000.06719.24
5.4.300.0170.06019.04
5.4.290.0000.07318.85
5.4.280.0070.07319.12
5.4.270.0070.06719.15
5.4.260.0070.06719.20
5.4.250.0100.07019.14
5.4.240.0000.07319.14
5.4.230.0130.04319.04
5.4.220.0070.04319.15
5.4.210.0100.07018.87
5.4.200.0070.03318.86
5.4.190.0100.06319.15
5.4.180.0070.07319.13
5.4.170.0000.04019.02
5.4.160.0070.07019.01
5.4.150.0030.05319.11
5.4.140.0000.06316.19
5.4.130.0070.02716.40
5.4.120.0070.05716.43
5.4.110.0070.07016.46
5.4.100.0000.07716.56
5.4.90.0030.07316.36
5.4.80.0070.07316.26
5.4.70.0070.07016.32
5.4.60.0030.06716.32
5.4.50.0030.07316.36
5.4.40.0100.06016.39
5.4.30.0030.07316.36
5.4.20.0100.06716.44
5.4.10.0100.06716.43
5.4.00.0030.06015.87
5.3.290.0100.07014.75
5.3.280.0000.07714.72
5.3.270.0030.07014.61
5.3.260.0000.08014.55
5.3.250.0070.06314.63
5.3.240.0030.07314.64
5.3.230.0070.07014.56
5.3.220.0030.04314.63
5.3.210.0030.06014.59
5.3.200.0030.07314.54
5.3.190.0100.07314.52
5.3.180.0000.08314.70
5.3.170.0000.08314.55
5.3.160.0100.06014.54
5.3.150.0000.04314.61
5.3.140.0000.06014.55
5.3.130.0030.08014.65
5.3.120.0000.07314.60
5.3.110.0030.07714.50
5.3.100.0070.07313.99
5.3.90.0030.07714.14
5.3.80.0000.06014.08
5.3.70.0000.07013.92
5.3.60.0030.04714.05
5.3.50.0000.05313.98
5.3.40.0070.06713.97
5.3.30.0000.04313.89
5.3.20.0030.05013.68
5.3.10.0000.04013.71
5.3.00.0130.03713.70
5.2.170.0000.06011.26
5.2.160.0000.06011.26
5.2.150.0000.06711.27
5.2.140.0070.03011.00
5.2.130.0070.05311.12
5.2.120.0030.03311.16
5.2.110.0000.06711.18
5.2.100.0000.03711.18
5.2.90.0000.06311.01
5.2.80.0030.06311.00
5.2.70.0070.05711.20
5.2.60.0000.05011.12
5.2.50.0030.03310.92
5.2.40.0000.04311.01
5.2.30.0030.03310.89
5.2.20.0000.06010.89
5.2.10.0070.05010.89
5.2.00.0000.03310.77
5.1.60.0000.0509.99
5.1.50.0030.03710.03
5.1.40.0030.0509.97
5.1.30.0000.04010.30
5.1.20.0070.05010.40
5.1.10.0030.03710.06
5.1.00.0000.0509.91
5.0.50.0030.0478.56
5.0.40.0070.0408.52
5.0.30.0030.0478.23
5.0.20.0070.0238.32
5.0.10.0030.0408.29
5.0.00.0030.0578.07
4.4.90.0030.0137.23
4.4.80.0030.0307.23
4.4.70.0000.0377.23
4.4.60.0000.0277.23
4.4.50.0030.0337.23
4.4.40.0000.0537.23
4.4.30.0000.0177.23
4.4.20.0030.0307.23
4.4.10.0000.0377.23
4.4.00.0000.0507.23
4.3.110.0000.0207.23
4.3.100.0070.0307.23
4.3.90.0030.0307.23
4.3.80.0030.0537.23
4.3.70.0000.0337.23
4.3.60.0000.0337.23
4.3.50.0000.0337.23
4.3.40.0030.0477.23
4.3.30.0100.0237.23
4.3.20.0000.0377.23
4.3.10.0070.0277.23
4.3.00.0030.0337.23

preferences:
34.34 ms | 401 KiB | 5 Q