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+-\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; } print_r (validate_date($filename1)); print_r (validate_date($filename2));

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.0070.01118.56
8.3.50.0110.00821.17
8.3.40.0070.00718.78
8.3.30.0070.01119.01
8.3.20.0000.00820.29
8.3.10.0040.00423.65
8.3.00.0080.00019.76
8.2.180.0120.00318.42
8.2.170.0110.00422.96
8.2.160.0070.00719.33
8.2.150.0110.00724.18
8.2.140.0050.00324.66
8.2.130.0020.00526.16
8.2.120.0040.00422.34
8.2.110.0040.00420.53
8.2.100.0080.00418.16
8.2.90.0000.00819.36
8.2.80.0040.00417.99
8.2.70.0030.00618.00
8.2.60.0060.00318.05
8.2.50.0000.01018.07
8.2.40.0040.00420.32
8.2.30.0080.00018.31
8.2.20.0040.00418.03
8.2.10.0040.00418.29
8.2.00.0000.00918.10
8.1.280.0070.01425.92
8.1.270.0040.00422.15
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00023.86
8.1.230.0040.00719.07
8.1.220.0000.00817.79
8.1.210.0000.00818.77
8.1.200.0100.00017.47
8.1.190.0080.00017.48
8.1.180.0000.00918.10
8.1.170.0030.00518.91
8.1.160.0000.00721.98
8.1.150.0070.00018.91
8.1.140.0060.00317.75
8.1.130.0030.00317.96
8.1.120.0000.00717.81
8.1.110.0050.00317.64
8.1.100.0000.00717.65
8.1.90.0070.00017.79
8.1.80.0000.00717.63
8.1.70.0000.00717.64
8.1.60.0040.00717.85
8.1.50.0040.00417.72
8.1.40.0080.00017.74
8.1.30.0090.00017.92
8.1.20.0040.00417.93
8.1.10.0030.00517.66
8.1.00.0000.00817.80
8.0.300.0070.00018.77
8.0.290.0070.00017.13
8.0.280.0030.00318.54
8.0.270.0040.00417.41
8.0.260.0030.00317.37
8.0.250.0030.00317.38
8.0.240.0000.00817.31
8.0.230.0040.00417.37
8.0.220.0000.00717.27
8.0.210.0000.00817.22
8.0.200.0050.00317.18
8.0.190.0050.00317.30
8.0.180.0050.00217.04
8.0.170.0080.00017.16
8.0.160.0070.00017.26
8.0.150.0030.00417.23
8.0.140.0040.00417.12
8.0.130.0000.00513.50
8.0.120.0040.00417.06
8.0.110.0000.00817.17
8.0.100.0070.00016.96
8.0.90.0000.00717.18
8.0.80.0160.00617.18
8.0.70.0000.00817.20
8.0.60.0040.00417.14
8.0.50.0040.00417.20
8.0.30.0150.00517.51
8.0.20.0080.01717.42
8.0.10.0000.00717.34
8.0.00.0030.01317.09
7.4.330.0050.00015.00
7.4.320.0030.00316.81
7.4.300.0030.00316.75
7.4.290.0000.00716.94
7.4.280.0030.00716.75
7.4.270.0000.00716.80
7.4.260.0030.00316.82
7.4.250.0000.00716.66
7.4.240.0020.00516.80
7.4.230.0040.00416.72
7.4.220.0040.01816.82
7.4.210.0070.00716.91
7.4.200.0000.00717.01
7.4.160.0100.00716.86
7.4.150.0030.01617.40
7.4.140.0120.00917.86
7.4.130.0140.00516.96
7.4.120.0110.00916.91
7.4.110.0170.00316.66
7.4.100.0110.00716.88
7.4.90.0080.00816.93
7.4.80.0090.01219.39
7.4.70.0050.01116.78
7.4.60.0070.01016.94
7.4.50.0050.00316.95
7.4.40.0070.01016.79
7.4.30.0090.00616.77
7.4.00.0060.01215.02
7.3.330.0000.00513.50
7.3.320.0020.00213.50
7.3.310.0040.00416.76
7.3.300.0030.00316.68
7.3.290.0070.00716.58
7.3.280.0100.00616.59
7.3.270.0130.00317.40
7.3.260.0070.01016.80
7.3.250.0130.00516.93
7.3.240.0090.01216.91
7.3.230.0130.00417.09
7.3.210.0070.01116.75
7.3.200.0080.00819.39
7.3.190.0000.01716.84
7.3.180.0140.00316.80
7.3.170.0120.01216.75
7.3.160.0060.00916.91
7.2.330.0060.01516.95
7.2.320.0060.01217.04
7.2.310.0100.01017.08
7.2.300.0100.00717.07
7.2.290.0130.01016.83
7.2.120.0070.00716.71
7.2.110.0000.00817.00
7.2.100.0120.00316.93
7.2.90.0070.00716.95
7.2.80.0100.00517.01
7.2.70.0100.00317.23
7.2.60.0080.00817.29
7.2.50.0040.00817.05
7.2.40.0040.01116.94
7.2.30.0140.00017.31
7.2.20.0090.00017.23
7.2.10.0000.01417.26
7.2.00.0020.01218.54
7.1.240.0090.00616.18
7.1.230.0070.00316.21
7.1.220.0000.01316.18
7.1.210.0070.00716.20
7.1.200.0080.00316.17
7.1.190.0040.00415.84
7.1.180.0060.00615.89
7.1.170.0060.00915.76
7.1.160.0000.01316.23
7.1.150.0040.00415.96
7.1.140.0060.00616.20
7.1.130.0030.00916.10
7.1.120.0070.00715.71
7.1.110.0030.01016.12
7.1.100.0030.00817.24
7.1.90.0060.00916.12
7.1.80.0100.00716.30
7.1.70.0060.00616.64
7.1.60.0070.01217.69
7.1.50.0070.01216.70
7.1.40.0070.00716.07
7.1.30.0030.00916.02
7.1.20.0030.01315.92
7.1.10.0030.00916.21
7.1.00.0050.04019.20
7.0.320.0040.00815.52
7.0.310.0050.00515.77
7.0.300.0070.00715.52
7.0.290.0040.00415.39
7.0.280.0060.00915.78
7.0.270.0000.01315.80
7.0.260.0060.01015.81
7.0.250.0030.01015.88
7.0.240.0100.00315.77
7.0.230.0040.00415.82
7.0.220.0090.00615.84
7.0.210.0000.01215.89
7.0.200.0000.01016.52
7.0.190.0030.01015.87
7.0.180.0000.01215.54
7.0.170.0000.01315.72
7.0.160.0030.00915.76
7.0.150.0000.01115.52
7.0.140.0020.04218.91
7.0.130.0060.00915.54
7.0.120.0060.00915.46
7.0.110.0030.01015.83
7.0.100.0120.04417.84
7.0.90.0070.03717.88
7.0.80.0110.03317.87
7.0.70.0050.03017.78
7.0.60.0080.04617.93
7.0.50.0130.03818.04
7.0.40.0130.03816.89
7.0.30.0050.04816.95
7.0.20.0040.04017.03
7.0.10.0050.04216.99
7.0.00.0070.02616.86
5.6.380.0030.01014.50
5.6.370.0030.01014.82
5.6.360.0070.00714.32
5.6.350.0060.01014.47
5.6.340.0090.00614.50
5.6.330.0030.00714.33
5.6.320.0040.00814.57
5.6.310.0060.01014.57
5.6.300.0080.00814.69
5.6.290.0060.00614.50
5.6.280.0000.04317.83
5.6.270.0000.01114.44
5.6.260.0040.00814.66
5.6.250.0080.04517.57
5.6.240.0080.03517.62
5.6.230.0070.04117.59
5.6.220.0120.03717.52
5.6.210.0050.04517.61
5.6.200.0110.02517.89
5.6.190.0050.03817.68
5.6.180.0080.04517.75
5.6.170.0050.04317.78
5.6.160.0110.04017.82
5.6.150.0100.04217.72
5.6.140.0020.05217.75
5.6.130.0060.04517.80
5.6.120.0030.04717.95
5.6.110.0070.04817.72
5.6.100.0070.04617.74
5.6.90.0050.02717.61
5.6.80.0020.03317.55
5.6.70.0050.04017.48
5.6.60.0080.04117.43
5.6.50.0130.03617.60
5.6.40.0080.03317.24
5.6.30.0030.03517.43
5.6.20.0090.02517.43
5.6.10.0100.02117.46
5.6.00.0170.01517.54
5.5.380.0070.04115.86
5.5.370.0080.04515.87
5.5.360.0050.04615.96
5.5.350.0080.04515.87
5.5.340.0030.04916.09
5.5.330.0030.03016.16
5.5.320.0060.04116.11
5.5.310.0090.03816.02
5.5.300.0080.04016.08
5.5.290.0030.04116.07
5.5.280.0080.04016.13
5.5.270.0030.05216.23
5.5.260.0120.03816.19
5.5.250.0050.03615.93
5.5.240.0050.04515.72
5.5.230.0030.04315.73
5.5.220.0100.03715.75
5.5.210.0030.03815.80
5.5.200.0070.04015.72
5.5.190.0110.04115.78
5.5.180.0080.03815.75
5.5.170.0100.00314.52
5.5.160.0060.04115.82
5.5.150.0100.04115.75
5.5.140.0040.03815.82
5.5.130.0120.04115.74
5.5.120.0110.02315.86
5.5.110.0020.04615.71
5.5.100.0030.02115.81
5.5.90.0130.03215.67
5.5.80.0090.03115.67
5.5.70.0070.03515.72
5.5.60.0090.02715.76
5.5.50.0050.02615.80
5.5.40.0050.03015.64
5.5.30.0030.02415.71
5.5.20.0070.02015.72
5.5.10.0080.02515.70
5.5.00.0080.02015.62
5.4.450.0080.04115.40
5.4.440.0120.03715.23
5.4.430.0020.04615.38
5.4.420.0090.03915.34
5.4.410.0070.03315.25
5.4.400.0070.03315.23
5.4.390.0060.04115.24
5.4.380.0020.04315.27
5.4.370.0070.04315.24
5.4.360.0050.04315.22
5.4.350.0070.04215.11
5.4.340.0090.04615.25
5.4.330.0070.00011.27
5.4.320.0050.02815.16
5.4.310.0060.02515.23
5.4.300.0040.03915.07
5.4.290.0070.02615.18
5.4.280.0090.03015.39
5.4.270.0030.02715.09
5.4.260.0000.02815.18
5.4.250.0090.03515.24
5.4.240.0050.04515.26
5.4.230.0030.02315.25
5.4.220.0050.03415.23
5.4.210.0050.02315.14
5.4.200.0120.01815.26
5.4.190.0050.02415.11
5.4.180.0030.02215.20
5.4.170.0070.02515.08
5.4.160.0060.02615.14
5.4.150.0020.03215.20
5.4.140.0100.01513.92
5.4.130.0050.03613.86
5.4.120.0090.02713.96
5.4.110.0070.03813.91
5.4.100.0020.04613.85
5.4.90.0050.03813.83
5.4.80.0070.03913.79
5.4.70.0060.02813.81
5.4.60.0050.03513.82
5.4.50.0000.02513.85
5.4.40.0050.02313.99
5.4.30.0030.03513.81
5.4.20.0050.02013.79
5.4.10.0070.02313.87
5.4.00.0060.01813.56
5.3.290.0000.02513.04
5.3.280.0050.02512.92
5.3.270.0050.03112.90
5.3.260.0020.02712.97
5.3.250.0080.01712.90
5.3.240.0050.02013.01
5.3.230.0010.02312.91
5.3.220.0020.02612.91
5.3.210.0070.02212.96
5.3.200.0100.03012.94
5.3.190.0070.02612.98
5.3.180.0120.03712.97
5.3.170.0050.02512.93
5.3.160.0030.02412.93
5.3.150.0060.02912.89
5.3.140.0090.02112.97
5.3.130.0100.01912.92
5.3.120.0030.02212.90
5.3.110.0060.02912.87
5.3.100.0050.03212.63
5.3.90.0020.02712.64
5.3.80.0070.01612.68
5.3.70.0030.02412.59
5.3.60.0070.02012.70
5.3.50.0050.01812.61
5.3.40.0030.01912.60
5.3.30.0050.01712.53
5.3.20.0050.02012.49
5.3.10.0020.02012.46
5.3.00.0050.01712.41
5.2.170.0000.02211.25
5.2.160.0020.01911.23
5.2.150.0070.01711.25
5.2.140.0060.02111.27
5.2.130.0030.01811.20
5.2.120.0040.01711.24
5.2.110.0030.01811.19
5.2.100.0030.02511.25
5.2.90.0050.01311.18
5.2.80.0020.01611.13
5.2.70.0020.01711.24
5.2.60.0020.01811.22
5.2.50.0060.01511.15
5.2.40.0060.01611.17
5.2.30.0030.01511.12
5.2.20.0030.01511.07
5.2.10.0050.01811.11
5.2.00.0010.01911.00
5.1.60.0020.01410.65
5.1.50.0050.01510.67
5.1.40.0040.01210.54
5.1.30.0050.01810.81
5.1.20.0030.02110.84
5.1.10.0030.01310.73
5.1.00.0000.01510.70
5.0.50.0040.0109.97
5.0.40.0020.0109.86
5.0.30.0080.0239.79
5.0.20.0030.0229.78
5.0.10.0020.0259.77
5.0.00.0020.0329.75
4.4.90.0020.0109.13
4.4.80.0020.0109.13
4.4.70.0020.0149.13
4.4.60.0000.0099.13
4.4.50.0000.0139.13
4.4.40.0020.0129.13
4.4.30.0030.0089.13
4.4.20.0020.0109.13
4.4.10.0000.0129.13
4.4.00.0020.0179.13
4.3.110.0050.0079.13
4.3.100.0000.0209.13
4.3.90.0010.0209.13
4.3.80.0010.0299.13
4.3.70.0020.0109.13
4.3.60.0020.0229.13
4.3.50.0030.0189.13
4.3.40.0030.0279.13
4.3.30.0010.0159.13
4.3.20.0030.0139.13
4.3.10.0000.0229.13
4.3.00.0000.0169.13

preferences:
44.8 ms | 401 KiB | 5 Q