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.0090.00918.93
8.3.50.0100.01221.19
8.3.40.0070.00719.21
8.3.30.0070.01119.29
8.3.20.0080.00020.29
8.3.10.0080.00023.57
8.3.00.0030.00519.63
8.2.180.0080.00818.79
8.2.170.0080.00622.96
8.2.160.0110.00419.29
8.2.150.0140.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0040.00422.18
8.2.110.0060.00321.15
8.2.100.0130.00317.91
8.2.90.0000.00919.30
8.2.80.0050.00518.00
8.2.70.0060.00317.88
8.2.60.0050.00318.16
8.2.50.0050.00318.07
8.2.40.0030.00518.20
8.2.30.0070.00018.30
8.2.20.0000.00718.02
8.2.10.0050.00218.14
8.2.00.0090.00018.04
8.1.280.0170.00325.92
8.1.270.0030.00623.84
8.1.260.0030.00526.35
8.1.250.0050.00228.09
8.1.240.0090.00021.54
8.1.230.0070.00419.07
8.1.220.0000.00817.79
8.1.210.0080.00018.77
8.1.200.0030.00617.60
8.1.190.0090.00017.50
8.1.180.0040.00418.10
8.1.170.0000.00718.82
8.1.160.0050.00218.87
8.1.150.0080.00018.97
8.1.140.0040.00417.61
8.1.130.0040.00417.84
8.1.120.0040.00417.79
8.1.110.0000.00917.70
8.1.100.0000.00717.73
8.1.90.0040.00417.77
8.1.80.0000.00817.73
8.1.70.0000.00717.61
8.1.60.0030.00517.86
8.1.50.0040.00417.73
8.1.40.0060.00317.74
8.1.30.0000.00917.78
8.1.20.0040.00417.88
8.1.10.0000.00717.82
8.1.00.0040.00417.71
8.0.300.0060.00319.03
8.0.290.0050.00317.13
8.0.280.0000.00718.55
8.0.270.0040.00417.27
8.0.260.0030.00517.36
8.0.250.0000.00717.21
8.0.240.0040.00417.33
8.0.230.0040.00417.32
8.0.220.0000.00717.19
8.0.210.0000.00817.23
8.0.200.0000.00717.22
8.0.190.0040.00417.25
8.0.180.0030.00617.11
8.0.170.0040.00417.22
8.0.160.0000.00717.08
8.0.150.0050.00317.20
8.0.140.0040.00417.10
8.0.130.0000.00513.58
8.0.120.0040.00417.18
8.0.110.0050.00317.18
8.0.100.0040.00417.25
8.0.90.0040.00417.14
8.0.80.0100.01317.08
8.0.70.0020.00517.16
8.0.60.0000.00717.08
8.0.50.0040.00417.13
8.0.30.0130.01417.40
8.0.20.0170.01117.48
8.0.10.0020.00517.22
8.0.00.0060.01217.04
7.4.330.0000.00515.00
7.4.320.0030.00316.79
7.4.300.0050.00316.85
7.4.290.0000.00816.69
7.4.280.0050.00516.78
7.4.270.0030.00316.91
7.4.260.0030.00516.88
7.4.250.0000.00816.84
7.4.240.0040.00316.81
7.4.230.0000.00716.98
7.4.220.0060.01216.74
7.4.210.0070.00716.85
7.4.200.0000.00716.78
7.4.160.0070.01016.75
7.4.150.0120.00617.40
7.4.140.0080.01117.86
7.4.130.0100.00916.94
7.4.120.0120.00616.83
7.4.110.0150.00516.62
7.4.100.0060.01216.66
7.4.90.0100.00716.98
7.4.80.0110.01119.39
7.4.70.0040.01216.81
7.4.60.0070.01016.78
7.4.50.0040.00416.88
7.4.40.0110.00616.77
7.4.30.0070.01016.99
7.4.00.0100.00415.33
7.3.330.0000.00613.45
7.3.320.0000.00613.47
7.3.310.0000.00716.65
7.3.300.0000.00716.71
7.3.290.0110.00716.56
7.3.280.0110.00416.60
7.3.270.0120.00617.40
7.3.260.0070.01016.84
7.3.250.0080.01016.67
7.3.240.0100.01416.68
7.3.230.0120.00616.96
7.3.210.0080.00816.67
7.3.200.0030.02019.39
7.3.190.0100.00716.65
7.3.180.0070.01116.66
7.3.170.0140.00716.79
7.3.160.0080.00816.85
7.3.120.0090.00915.24
7.3.110.0100.01015.15
7.3.100.0110.00615.20
7.3.90.0080.00715.21
7.3.80.0030.00915.15
7.3.70.0080.00715.09
7.3.60.0000.01515.16
7.3.50.0070.00715.04
7.3.40.0030.01015.12
7.3.30.0050.01015.10
7.3.20.0070.00317.05
7.3.10.0000.01516.97
7.3.00.0050.00917.03
7.2.330.0150.00317.11
7.2.320.0070.01616.89
7.2.310.0070.01416.84
7.2.300.0060.01016.84
7.2.290.0080.01517.03
7.2.250.0100.00815.42
7.2.240.0070.01015.36
7.2.230.0030.01415.28
7.2.220.0050.00615.36
7.2.210.0070.00715.28
7.2.200.0060.00815.36
7.2.190.0090.00515.39
7.2.180.0090.00315.20
7.2.170.0060.00915.09
7.2.160.0090.00615.34
7.2.150.0000.01617.29
7.2.140.0060.00617.12
7.2.130.0090.00317.02
7.2.120.0100.00316.96
7.2.110.0030.00716.99
7.2.100.0030.00817.24
7.2.90.0070.00317.28
7.2.80.0080.00417.34
7.2.70.0030.01217.00
7.2.60.0020.01117.24
7.2.50.0030.01317.34
7.2.40.0130.00317.17
7.2.30.0040.00717.29
7.2.20.0030.01217.15
7.2.10.0070.01016.89
7.2.00.0020.01018.57
7.1.330.0060.00816.14
7.1.320.0050.00816.14
7.1.310.0030.01015.88
7.1.300.0050.00616.05
7.1.290.0080.00616.15
7.1.280.0120.00316.10
7.1.270.0050.01116.09
7.1.260.0070.00816.13
7.1.250.0030.01316.19
7.1.240.0060.00616.20
7.1.230.0110.00315.89
7.1.220.0040.00716.20
7.1.210.0160.00016.04
7.1.200.0070.00716.13
7.1.190.0060.00616.05
7.1.180.0040.01115.89
7.1.170.0020.00616.13
7.1.160.0100.00315.96
7.1.150.0110.00415.72
7.1.140.0040.01215.88
7.1.130.0070.00716.14
7.1.120.0100.00316.11
7.1.110.0100.00716.28
7.1.100.0070.00817.32
7.1.90.0060.00616.07
7.1.80.0000.01215.97
7.1.70.0060.00516.86
7.1.60.0120.00717.79
7.1.50.0050.01316.62
7.1.40.0040.01115.87
7.1.30.0040.00715.90
7.1.20.0050.00416.02
7.1.10.0060.00316.18
7.1.00.0050.04219.12
7.0.330.0070.00715.51
7.0.320.0100.00315.49
7.0.310.0100.00315.82
7.0.300.0080.00415.77
7.0.290.0000.01415.87
7.0.280.0090.00315.30
7.0.270.0100.00715.78
7.0.260.0030.01015.71
7.0.250.0030.01015.86
7.0.240.0070.00415.95
7.0.230.0030.00815.66
7.0.220.0000.00915.85
7.0.210.0030.01015.64
7.0.200.0090.00616.37
7.0.190.0030.01315.61
7.0.180.0040.01215.66
7.0.170.0080.00515.65
7.0.160.0030.01015.50
7.0.150.0090.00915.68
7.0.140.0030.04318.98
7.0.130.0070.00715.79
7.0.120.0030.00715.88
7.0.110.0030.01015.74
7.0.100.0000.01515.81
7.0.90.0030.01015.56
7.0.80.0050.04317.91
7.0.70.0130.03117.85
7.0.60.0100.04117.86
7.0.50.0300.04118.03
7.0.40.0020.04116.97
7.0.30.0100.03516.93
7.0.20.0130.03716.93
7.0.10.0060.04316.87
7.0.00.0090.04416.95
5.6.400.0030.00914.57
5.6.390.0000.01114.46
5.6.380.0040.01214.21
5.6.370.0070.00714.51
5.6.360.0040.01114.73
5.6.350.0060.00614.90
5.6.340.0000.00814.41
5.6.330.0100.00714.85
5.6.320.0060.00614.80
5.6.310.0040.00814.70
5.6.300.0070.01014.86
5.6.290.0040.01114.46
5.6.280.0070.03717.85
5.6.270.0070.00714.58
5.6.260.0080.00614.96
5.6.250.0040.00814.34
5.6.240.0030.01014.70
5.6.230.0070.04517.49
5.6.220.0120.04217.63
5.6.210.0030.04617.66
5.6.200.0060.04717.85
5.6.190.0070.04717.69
5.6.180.0020.04617.85
5.6.170.0030.05117.73
5.6.160.0090.04317.92
5.6.150.0090.04117.86
5.6.140.0060.04317.88
5.6.130.0100.04217.87
5.6.120.0030.04717.71
5.6.110.0110.04317.62
5.6.100.0120.04217.76
5.6.90.0050.04517.73
5.6.80.0090.03517.40
5.6.70.0020.02617.46
5.6.60.0080.04317.49
5.6.50.0090.03617.51
5.6.40.0070.04217.51
5.6.30.0080.02717.47
5.6.20.0070.04417.41
5.6.10.0070.04117.41
5.6.00.0090.04217.42
5.5.380.0080.00614.48
5.5.370.0090.03317.39
5.5.360.0050.04217.50
5.5.350.0070.03917.37
5.5.340.0070.03217.79
5.5.330.0070.04717.76
5.5.320.0070.04417.55
5.5.310.0070.04317.73
5.5.300.0000.03517.56
5.5.290.0080.04317.63
5.5.280.0040.04517.77
5.5.270.0050.04517.64
5.5.260.0080.04217.54
5.5.250.0020.04917.46
5.5.240.0060.03117.01
5.5.230.0050.03017.38
5.5.220.0050.03017.31
5.5.210.0080.03317.16
5.5.200.0070.04017.14
5.5.190.0050.03717.11
5.5.180.0090.04617.19
5.5.170.0030.00914.40
5.5.160.0110.04417.31
5.5.150.0060.02517.21
5.5.140.0100.02717.19
5.5.130.0050.02617.29
5.5.120.0060.02517.38
5.5.110.0070.03217.24
5.5.100.0060.03117.18
5.5.90.0070.03617.16
5.5.80.0050.04616.98
5.5.70.0070.03017.18
5.5.60.0050.02017.34
5.5.50.0050.02417.15
5.5.40.0130.01817.33
5.5.30.0070.03517.04
5.5.20.0100.04016.98
5.5.10.0070.03417.12
5.5.00.0040.02817.27
5.4.450.0070.04015.22
5.4.440.0080.03515.31
5.4.430.0060.03215.32
5.4.420.0150.03515.48
5.4.410.0050.04515.30
5.4.400.0080.03015.10
5.4.390.0020.04514.95
5.4.380.0030.03614.97
5.4.370.0080.04115.19
5.4.360.0060.04215.10
5.4.350.0050.04114.97
5.4.340.0080.04014.88
5.4.330.0080.00011.32
5.4.320.0070.04115.12
5.4.310.0060.03815.07
5.4.300.0070.02114.90
5.4.290.0060.03115.00
5.4.280.0060.02315.25
5.4.270.0050.02215.25
5.4.260.0020.03015.15
5.4.250.0100.02315.12
5.4.240.0020.03215.04
5.4.230.0030.02415.05
5.4.220.0020.02514.89
5.4.210.0070.01815.10
5.4.200.0080.01415.13
5.4.190.0040.02415.09
5.4.180.0050.04315.08
5.4.170.0020.02615.08
5.4.160.0080.03514.91
5.4.150.0020.04615.14
5.4.140.0070.04013.70
5.4.130.0100.03113.86
5.4.120.0110.01613.86
5.4.110.0030.02913.64
5.4.100.0050.02713.65
5.4.90.0070.02013.69
5.4.80.0030.02213.64
5.4.70.0020.02413.72
5.4.60.0020.02013.73
5.4.50.0030.02913.85
5.4.40.0070.01813.94
5.4.30.0050.02613.98
5.4.20.0070.03413.73
5.4.10.0050.02113.59
5.4.00.0060.02013.33
5.3.290.0170.05714.68
5.3.280.0030.03014.65
5.3.270.0130.07014.55
5.3.260.0070.05714.66
5.3.250.0000.05714.66
5.3.240.0030.05714.54
5.3.230.0100.03314.63
5.3.220.0070.05014.66
5.3.210.0070.06014.50
5.3.200.0000.05714.60
5.3.190.0000.04014.59
5.3.180.0000.04014.70
5.3.170.0030.04014.54
5.3.160.0100.04714.71
5.3.150.0000.04014.59
5.3.140.0000.04014.56
5.3.130.0070.06714.52
5.3.120.0070.05014.58
5.3.110.0070.04014.55
5.3.100.0030.06314.01
5.3.90.0100.04714.02
5.3.80.0070.03314.09
5.3.70.0030.04014.11
5.3.60.0100.07014.06
5.3.50.0070.05013.94
5.3.40.0000.04014.09
5.3.30.0030.03713.96
5.3.20.0100.03313.72
5.3.10.0000.03713.76
5.3.00.0030.05713.77
5.2.170.0070.02711.47
5.2.160.0030.03011.47
5.2.150.0070.03011.47
5.2.140.0070.03711.47
5.2.130.0070.04711.47
5.2.120.0000.03711.47
5.2.110.0000.03011.47
5.2.100.0000.03011.47
5.2.90.0100.02311.47
5.2.80.0070.02311.47
5.2.70.0030.03011.47
5.2.60.0000.03011.47
5.2.50.0170.02011.47
5.2.40.0030.03011.47
5.2.30.0030.05711.47
5.2.20.0000.03311.47
5.2.10.0000.06311.47
5.2.00.0070.05711.47
5.1.60.0030.05711.47
5.1.50.0130.04311.47
5.1.40.0130.04711.47
5.1.30.0100.05011.47
5.1.20.0030.04311.47
5.1.10.0100.03711.47
5.1.00.0030.04311.47
5.0.50.0030.04711.47
5.0.40.0070.04011.47
5.0.30.0030.06311.47
5.0.20.0070.02311.47
5.0.10.0000.05011.47
5.0.00.0030.06011.47
4.4.90.0000.02011.47
4.4.80.0030.01311.47
4.4.70.0030.03711.47
4.4.60.0030.03311.47
4.4.50.0000.03711.47
4.4.40.0000.05311.47
4.4.30.0000.03711.47
4.4.20.0000.03011.47
4.4.10.0070.02011.47
4.4.00.0000.05711.47
4.3.110.0030.03711.47
4.3.100.0070.02711.47
4.3.90.0000.03711.47
4.3.80.0030.04311.47
4.3.70.0030.04011.47
4.3.60.0070.03311.47
4.3.50.0030.03311.47
4.3.40.0030.04711.47
4.3.30.0030.03311.47
4.3.20.0030.03711.47
4.3.10.0000.03011.47
4.3.00.0070.03011.47

preferences:
49.79 ms | 401 KiB | 5 Q