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.60.0110.00718.81
8.3.50.0110.01118.41
8.3.40.0090.00619.22
8.3.30.0100.00719.22
8.3.20.0050.00220.33
8.3.10.0050.00323.60
8.3.00.0060.00319.63
8.2.180.0070.01318.88
8.2.170.0080.00822.96
8.2.160.0090.00919.33
8.2.150.0070.00724.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00422.15
8.2.110.0030.00719.45
8.2.100.0120.00018.09
8.2.90.0050.00319.17
8.2.80.0000.00818.00
8.2.70.0060.00318.00
8.2.60.0080.00018.16
8.2.50.0080.00018.10
8.2.40.0030.00620.25
8.2.30.0000.00918.11
8.2.20.0000.00718.08
8.2.10.0030.00618.27
8.2.00.0080.00018.12
8.1.280.0090.00925.92
8.1.270.0050.00322.21
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.79
8.1.230.0080.00317.89
8.1.220.0030.00517.80
8.1.210.0040.00418.77
8.1.200.0060.00317.60
8.1.190.0040.00417.47
8.1.180.0000.00818.10
8.1.170.0040.00418.87
8.1.160.0000.00722.11
8.1.150.0000.00718.92
8.1.140.0040.00417.75
8.1.130.0000.00717.84
8.1.120.0040.00417.79
8.1.110.0030.00617.82
8.1.100.0040.00417.66
8.1.90.0040.00417.75
8.1.80.0030.00517.71
8.1.70.0000.00817.69
8.1.60.0040.00417.79
8.1.50.0040.00417.65
8.1.40.0040.00417.65
8.1.30.0000.00817.80
8.1.20.0030.00517.79
8.1.10.0000.00717.71
8.1.00.0000.00817.80
8.0.300.0030.00618.77
8.0.290.0040.00416.88
8.0.280.0000.00818.56
8.0.270.0000.00717.25
8.0.260.0060.00017.33
8.0.250.0030.00317.19
8.0.240.0000.00817.30
8.0.230.0000.00717.30
8.0.220.0030.00317.15
8.0.210.0070.00017.29
8.0.200.0040.00417.11
8.0.190.0040.00417.16
8.0.180.0000.00817.13
8.0.170.0040.00417.12
8.0.160.0050.00217.15
8.0.150.0000.00717.19
8.0.140.0040.00417.01
8.0.130.0050.00013.60
8.0.120.0050.00317.15
8.0.110.0000.00817.18
8.0.100.0040.00417.18
8.0.90.0030.00517.05
8.0.80.0070.01117.17
8.0.70.0040.00417.18
8.0.60.0040.00417.13
8.0.50.0040.00417.21
8.0.30.0080.01317.38
8.0.20.0110.01417.40
8.0.10.0040.00417.32
8.0.00.0090.00817.34
7.4.330.0020.00215.00
7.4.320.0060.00016.80
7.4.300.0030.00316.86
7.4.290.0040.00416.75
7.4.280.0030.00716.89
7.4.270.0080.00016.81
7.4.260.0060.00316.89
7.4.250.0070.00016.85
7.4.240.0060.00216.93
7.4.230.0000.01016.91
7.4.220.0070.01016.84
7.4.210.0160.00016.93
7.4.200.0020.00516.62
7.4.160.0080.00816.79
7.4.150.0100.00717.40
7.4.140.0120.00817.86
7.4.130.0060.01116.73
7.4.120.0080.00916.84
7.4.110.0170.00317.05
7.4.100.0120.00616.82
7.4.90.0130.00316.94
7.4.80.0120.00819.39
7.4.70.0070.01316.95
7.4.60.0130.00716.88
7.4.50.0000.00616.80
7.4.40.0110.00716.98
7.4.30.0130.01016.77
7.4.00.0100.00715.27
7.3.330.0030.00313.59
7.3.320.0060.00013.59
7.3.310.0040.00416.71
7.3.300.0030.00316.51
7.3.290.0030.01216.63
7.3.280.0080.00916.61
7.3.270.0100.00717.40
7.3.260.0040.01316.84
7.3.250.0100.00716.79
7.3.240.0080.01216.83
7.3.230.0110.00617.06
7.3.210.0060.01216.78
7.3.200.0080.00919.39
7.3.190.0060.01216.72
7.3.180.0060.01016.98
7.3.170.0090.00916.77
7.3.160.0060.01016.86
7.3.10.0070.01016.85
7.3.00.0000.01716.94
7.2.330.0090.00916.87
7.2.320.0030.01417.01
7.2.310.0090.00917.00
7.2.300.0000.01516.94
7.2.290.0130.00417.12
7.2.130.0120.00317.25
7.2.120.0130.00317.19
7.2.110.0060.00616.75
7.2.100.0100.00717.18
7.2.90.0040.01117.11
7.2.80.0090.01217.34
7.2.70.0150.00316.85
7.2.60.0050.00917.21
7.2.50.0070.01417.27
7.2.40.0070.01016.93
7.2.30.0130.01016.90
7.2.20.0090.00917.02
7.2.10.0110.00317.19
7.2.00.0050.00718.27
7.1.250.0030.01015.88
7.1.200.0060.00616.13
7.1.100.0070.00718.24
7.1.70.0000.00817.25
7.1.60.0140.01019.32
7.1.50.0100.01417.44
7.1.00.0100.07022.36
7.0.200.0030.00317.23
7.0.140.0000.07722.04
7.0.90.0070.04321.71
7.0.80.0070.07321.93
7.0.70.0030.03721.76
7.0.60.0030.07721.75
7.0.50.0030.05322.20
7.0.40.0000.04320.18
7.0.30.0170.04020.15
7.0.20.0000.08320.18
7.0.10.0070.06019.98
7.0.00.0030.08320.11
5.6.280.0130.06321.13
5.6.240.0000.08020.58
5.6.230.0100.07720.54
5.6.220.0030.08020.58
5.6.210.0000.08020.56
5.6.200.0000.07321.04
5.6.190.0000.04020.96
5.6.180.0070.07321.12
5.6.170.0100.07321.08
5.6.160.0100.06721.18
5.6.150.0030.09320.96
5.6.140.0070.06721.00
5.6.130.0130.07021.13
5.6.120.0070.07320.88
5.6.110.0000.06721.03
5.6.100.0070.04021.11
5.6.90.0100.04720.92
5.6.80.0000.08020.39
5.6.70.0170.03320.49
5.6.60.0000.05020.46
5.6.50.0030.06020.47
5.6.40.0100.06320.31
5.6.30.0070.07320.42
5.6.20.0030.05020.45
5.6.10.0000.08720.43
5.6.00.0070.05020.40
5.5.380.0030.05020.36
5.5.370.0070.07020.50
5.5.360.0070.03320.41
5.5.350.0030.07020.46
5.5.340.0070.04320.78
5.5.330.0030.07720.74
5.5.320.0130.03020.90
5.5.310.0070.07720.76
5.5.300.0000.08320.73
5.5.290.0000.08720.89
5.5.280.0070.08320.84
5.5.270.0070.09320.93
5.5.260.0030.08720.86
5.5.250.0100.07020.70
5.5.240.0030.04720.27
5.5.230.0030.08020.26
5.5.220.0030.08720.01
5.5.210.0000.05020.02
5.5.200.0100.05020.28
5.5.190.0030.08020.18
5.5.180.0230.03720.13
5.5.160.0070.07320.11
5.5.150.0000.08320.18
5.5.140.0000.04020.25
5.5.130.0070.06320.21
5.5.120.0070.07320.13
5.5.110.0070.06020.25
5.5.100.0030.08320.05
5.5.90.0070.06320.07
5.5.80.0100.06720.10
5.5.70.0100.06720.16
5.5.60.0000.05319.90
5.5.50.0030.07720.06
5.5.40.0000.05320.06
5.5.30.0000.07020.13
5.5.20.0100.03720.05
5.5.10.0000.07020.10
5.5.00.0030.07719.97
5.4.450.0030.07719.48
5.4.440.0000.07019.23
5.4.430.0100.06019.50
5.4.420.0000.04319.16
5.4.410.0000.07719.40
5.4.400.0100.07019.13
5.4.390.0070.07719.18
5.4.380.0130.06719.05
5.4.370.0030.05319.21
5.4.360.0030.07719.16
5.4.350.0030.06719.06
5.4.340.0100.06719.18
5.4.320.0000.05318.95
5.4.310.0030.04319.05
5.4.300.0000.05319.21
5.4.290.0070.04018.88
5.4.280.0100.05018.95
5.4.270.0030.04719.22
5.4.260.0100.06718.87
5.4.250.0030.05319.11
5.4.240.0130.05019.22
5.4.230.0100.07019.22
5.4.220.0030.07719.22
5.4.210.0000.04719.12
5.4.200.0100.07318.85
5.4.190.0070.07018.89
5.4.180.0030.05019.20
5.4.170.0100.05319.22
5.4.160.0030.08019.02
5.4.150.0030.05318.88
5.4.140.0000.07316.34
5.4.130.0030.07016.41
5.4.120.0000.07016.41
5.4.110.0070.07016.36
5.4.100.0030.07716.46
5.4.90.0000.07016.46
5.4.80.0130.05716.49
5.4.70.0000.04316.42
5.4.60.0030.07316.34
5.4.50.0070.06716.40
5.4.40.0030.03716.35
5.4.30.0070.03016.24
5.4.20.0030.07316.43
5.4.10.0000.08016.39
5.4.00.0030.05315.86
5.3.290.0030.07314.80
5.3.280.0030.07014.69
5.3.270.0000.06314.63
5.3.260.0000.05314.62
5.3.250.0000.06714.58
5.3.240.0000.07314.69
5.3.230.0030.07014.56
5.3.220.0030.07314.52
5.3.210.0070.07714.63
5.3.200.0030.07014.63
5.3.190.0030.07714.49
5.3.180.0030.04014.58
5.3.170.0030.07314.48
5.3.160.0070.07314.57
5.3.150.0000.05714.58
5.3.140.0030.07314.54
5.3.130.0000.07314.61
5.3.120.0070.06014.47
5.3.110.0000.08014.60
5.3.100.0070.07014.15
5.3.90.0030.07014.08
5.3.80.0000.04314.14
5.3.70.0070.06714.12
5.3.60.0030.03714.02
5.3.50.0070.07314.07
5.3.40.0070.06713.93
5.3.30.0130.06314.01
5.3.20.0030.05013.75
5.3.10.0030.07313.74
5.3.00.0030.06713.54
5.2.170.0030.06011.20
5.2.160.0030.06311.03
5.2.150.0030.06011.01
5.2.140.0000.04011.04
5.2.130.0070.05310.96
5.2.120.0030.06011.19
5.2.110.0070.05711.20
5.2.100.0030.05711.23
5.2.90.0030.04311.03
5.2.80.0030.06011.10
5.2.70.0000.06711.23
5.2.60.0100.05711.14
5.2.50.0000.06311.02
5.2.40.0000.03710.86
5.2.30.0000.03710.89
5.2.20.0030.06011.07
5.2.10.0030.02710.89
5.2.00.0030.05710.63
5.1.60.0000.02710.11
5.1.50.0030.05310.08
5.1.40.0000.03010.11
5.1.30.0000.03010.33
5.1.20.0000.05310.21
5.1.10.0100.04710.08
5.1.00.0000.05710.12
5.0.50.0000.0339.01
5.0.40.0030.0379.01
5.0.30.0070.0409.01
5.0.20.0000.0379.01
5.0.10.0100.0379.01
5.0.00.0000.0539.01
4.4.90.0000.0339.01
4.4.80.0070.0239.01
4.4.70.0000.0339.01
4.4.60.0000.0279.01
4.4.50.0000.0209.01
4.4.40.0030.0509.01
4.4.30.0000.0339.01
4.4.20.0000.0379.01
4.4.10.0000.0339.01
4.4.00.0030.0439.01
4.3.110.0030.0339.01
4.3.100.0030.0239.01
4.3.90.0000.0379.01
4.3.80.0000.0239.01
4.3.70.0030.0309.01
4.3.60.0070.0239.01
4.3.50.0000.0339.01
4.3.40.0000.0379.01
4.3.30.0070.0309.01
4.3.20.0000.0379.01
4.3.10.0000.0279.01
4.3.00.0000.0339.01

preferences:
55.29 ms | 400 KiB | 5 Q