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"; $filename3 = "9-29-2014.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($filename3)); //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.70.0030.01318.68
8.3.60.0160.01018.43
8.3.50.0140.00821.29
8.3.40.0090.00618.93
8.3.30.0100.00319.17
8.3.20.0000.00820.25
8.3.10.0040.00421.91
8.3.00.0000.00819.50
8.2.180.0070.00718.55
8.2.170.0110.00322.96
8.2.160.0030.01420.38
8.2.150.0110.00424.18
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0100.00020.32
8.2.110.0080.00319.39
8.2.100.0080.00318.03
8.2.90.0030.00519.16
8.2.80.0040.00417.97
8.2.70.0060.00317.75
8.2.60.0040.00417.93
8.2.50.0000.00918.07
8.2.40.0080.00417.88
8.2.30.0040.00418.21
8.2.20.0040.00417.87
8.2.10.0040.00418.16
8.2.00.0000.00717.99
8.1.280.0150.00625.92
8.1.270.0050.00322.13
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.19
8.1.230.0040.00719.09
8.1.220.0060.00317.74
8.1.210.0050.00518.77
8.1.200.0030.00617.48
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0000.00918.79
8.1.160.0000.00722.05
8.1.150.0050.00218.85
8.1.140.0040.00417.55
8.1.130.0070.00017.87
8.1.120.0040.00417.62
8.1.110.0030.00617.57
8.1.100.0000.00717.55
8.1.90.0000.00817.63
8.1.80.0000.00717.68
8.1.70.0000.00717.63
8.1.60.0110.00017.75
8.1.50.0060.00317.64
8.1.40.0040.00417.54
8.1.30.0040.00417.66
8.1.20.0040.00417.86
8.1.10.0040.00417.78
8.1.00.0050.00317.56
8.0.300.0000.00720.29
8.0.290.0070.00017.13
8.0.280.0070.00018.39
8.0.270.0050.00317.25
8.0.260.0000.00817.21
8.0.250.0000.00617.13
8.0.240.0000.00817.11
8.0.230.0050.00317.02
8.0.220.0040.00416.93
8.0.210.0000.00716.99
8.0.200.0070.00017.12
8.0.190.0050.00217.09
8.0.180.0040.00416.99
8.0.170.0040.00417.13
8.0.160.0030.00517.06
8.0.150.0070.00016.88
8.0.140.0040.00416.93
8.0.130.0000.00613.39
8.0.120.0030.00617.06
8.0.110.0050.00317.07
8.0.100.0070.00017.09
8.0.90.0000.00816.99
8.0.80.0120.00917.07
8.0.70.0030.00617.12
8.0.60.0040.00416.86
8.0.50.0000.00816.93
8.0.30.0150.00717.04
8.0.20.0090.01317.47
8.0.10.0040.00417.07
8.0.00.0100.00716.91
7.4.330.0000.00515.00
7.4.320.0060.00016.95
7.4.300.0000.00716.82
7.4.290.0050.00316.66
7.4.280.0090.00316.88
7.4.270.0070.00016.89
7.4.260.0000.00716.91
7.4.250.0000.00716.79
7.4.240.0040.00316.83
7.4.230.0000.00716.61
7.4.220.0070.01016.95
7.4.210.0060.01016.94
7.4.200.0030.00316.66
7.4.160.0080.00816.96
7.4.150.0060.01317.40
7.4.140.0140.01017.86
7.4.130.0100.01216.88
7.4.120.0070.00916.89
7.4.110.0200.00416.75
7.4.100.0150.00316.75
7.4.90.0130.01116.89
7.4.80.0080.01319.39
7.4.70.0050.01017.02
7.4.60.0080.00816.83
7.4.50.0040.00416.71
7.4.40.0070.01016.79
7.4.30.0040.01416.84
7.4.10.0070.01115.05
7.4.00.0040.01015.22
7.3.330.0050.00013.50
7.3.320.0000.00613.51
7.3.310.0000.00716.55
7.3.300.0070.00016.65
7.3.290.0070.00716.55
7.3.280.0090.00816.58
7.3.270.0170.00317.40
7.3.260.0090.01216.80
7.3.250.0040.01316.74
7.3.240.0130.00316.79
7.3.230.0080.01116.76
7.3.210.0100.00616.84
7.3.200.0030.01919.39
7.3.190.0160.00716.76
7.3.180.0060.01016.66
7.3.170.0120.00616.85
7.3.160.0060.01316.85
7.3.130.0100.00715.45
7.3.120.0050.01315.11
7.3.110.0020.01415.22
7.3.100.0070.00915.13
7.3.90.0050.00714.98
7.3.80.0080.00815.03
7.3.70.0000.01015.21
7.3.60.0060.00615.12
7.3.50.0080.00615.13
7.3.40.0050.00715.04
7.3.30.0090.00715.26
7.3.20.0060.00617.12
7.3.10.0060.00517.00
7.3.00.0030.01016.90
7.2.330.0030.01317.06
7.2.320.0130.00617.05
7.2.310.0060.01016.98
7.2.300.0160.00316.94
7.2.290.0120.00916.89
7.2.260.0060.01315.29
7.2.250.0070.01015.29
7.2.240.0060.01115.46
7.2.230.0070.01115.41
7.2.220.0030.01015.22
7.2.210.0040.00815.48
7.2.200.0040.01015.34
7.2.190.0090.00515.16
7.2.180.0040.00915.25
7.2.170.0020.01115.21
7.2.160.0040.01115.51
7.2.150.0030.01017.20
7.2.140.0120.00317.03
7.2.130.0090.00617.18
7.2.120.0090.00617.11
7.2.110.0040.01117.18
7.2.100.0100.00617.21
7.2.90.0000.01417.34
7.2.80.0040.00716.96
7.2.70.0000.01117.24
7.2.60.0090.00717.09
7.2.50.0030.01017.16
7.2.40.0130.00317.30
7.2.30.0030.01317.22
7.2.20.0100.00717.30
7.2.10.0040.01417.23
7.2.00.0090.00618.58
7.1.330.0060.00716.24
7.1.320.0100.00516.04
7.1.310.0030.01216.24
7.1.300.0030.01216.22
7.1.290.0000.01215.92
7.1.280.0100.00416.14
7.1.270.0080.00516.00
7.1.260.0060.00615.99
7.1.250.0000.01216.11
7.1.240.0090.00316.26
7.1.230.0060.00616.10
7.1.220.0040.01116.16
7.1.210.0060.01015.82
7.1.200.0020.00816.14
7.1.190.0000.01516.25
7.1.180.0030.01415.99
7.1.170.0000.01116.23
7.1.160.0030.01316.21
7.1.150.0100.00315.98
7.1.140.0000.01616.17
7.1.130.0040.01216.27
7.1.120.0040.01116.18
7.1.110.0030.01016.25
7.1.100.0090.00315.75
7.1.90.0030.00916.09
7.1.80.0060.01216.00
7.1.70.0020.01016.88
7.1.60.0050.00717.02
7.1.50.0050.01216.74
7.1.40.0030.00715.98
7.1.30.0060.00616.29
7.1.20.0120.00316.00
7.1.10.0030.01016.11
7.1.00.0070.03919.22
7.0.330.0070.00715.78
7.0.320.0110.00415.75
7.0.310.0090.00315.76
7.0.300.0060.00915.78
7.0.290.0090.00615.69
7.0.280.0100.00315.50
7.0.270.0030.00615.79
7.0.260.0140.00315.67
7.0.250.0080.00815.86
7.0.240.0070.00715.77
7.0.230.0000.01515.58
7.0.220.0060.00615.85
7.0.210.0030.01615.59
7.0.200.0040.00616.53
7.0.190.0040.01115.87
7.0.180.0100.00315.71
7.0.170.0090.00615.56
7.0.160.0100.00315.59
7.0.150.0000.01115.91
7.0.140.0050.04018.82
7.0.130.0030.01015.71
7.0.120.0100.00315.65
7.0.110.0090.00315.70
7.0.100.0090.04117.85
7.0.90.0060.04517.79
7.0.80.0150.03717.93
7.0.70.0080.04017.90
7.0.60.0080.05117.76
7.0.50.0060.02818.10
7.0.40.0070.02916.96
7.0.30.0090.04216.84
7.0.20.0070.04316.88
7.0.10.0110.04216.93
7.0.00.0120.04016.98
5.6.400.0090.00614.70
5.6.390.0090.00314.48
5.6.380.0000.01114.29
5.6.370.0030.00914.63
5.6.360.0030.00714.63
5.6.350.0040.00914.45
5.6.340.0090.00614.85
5.6.330.0080.00414.38
5.6.320.0040.01114.65
5.6.310.0060.01314.50
5.6.300.0070.00714.63
5.6.290.0120.00314.63
5.6.280.0070.03517.86
5.6.270.0080.00814.61
5.6.260.0130.00014.52
5.6.250.0050.03117.43
5.6.240.0030.03117.62
5.6.230.0120.03317.59
5.6.220.0100.04317.56
5.6.210.0050.04517.54
5.6.200.0120.03817.87
5.6.190.0080.04117.67
5.6.180.0090.04517.96
5.6.170.0020.04417.81
5.6.160.0070.02717.84
5.6.150.0110.04117.81
5.6.140.0100.03217.82
5.6.130.0100.03217.90
5.6.120.0050.02717.71
5.6.110.0070.02217.88
5.6.100.0030.04617.62
5.6.90.0090.03717.85
5.6.80.0090.04117.53
5.6.70.0130.04017.54
5.6.60.0120.04117.39
5.6.50.0130.04017.34
5.6.40.0060.04617.60
5.6.30.0060.02817.59
5.6.20.0040.02817.44
5.6.10.0080.04417.27
5.6.00.0100.02317.45
5.5.380.0020.04517.26
5.5.370.0070.03017.40
5.5.360.0120.03517.57
5.5.350.0150.02517.29
5.5.340.0120.04317.76
5.5.330.0050.04717.43
5.5.320.0070.04017.68
5.5.310.0080.03017.67
5.5.300.0050.02917.72
5.5.290.0090.02217.82
5.5.280.0080.02017.85
5.5.270.0030.04617.57
5.5.260.0070.03817.83
5.5.250.0070.04217.41
5.5.240.0020.04917.22
5.5.230.0070.04517.26
5.5.220.0120.03917.22
5.5.210.0120.04017.13
5.5.200.0140.03217.13
5.5.190.0080.03817.38
5.5.180.0080.03717.15
5.5.170.0060.00914.50
5.5.160.0100.03017.22
5.5.150.0100.04017.19
5.5.140.0030.04817.36
5.5.130.0090.03517.27
5.5.120.0020.03317.27
5.5.110.0050.03517.22
5.5.100.0060.03317.22
5.5.90.0080.03817.16
5.5.80.0070.02517.18
5.5.70.0100.02317.21
5.5.60.0090.02217.30
5.5.50.0110.01917.42
5.5.40.0020.02517.25
5.5.30.0030.02517.39
5.5.20.0000.02617.33
5.5.10.0080.02317.26
5.5.00.0060.01917.09
5.4.450.0050.04415.26
5.4.440.0080.02815.16
5.4.430.0040.04215.42
5.4.420.0060.03115.30
5.4.410.0050.03815.37
5.4.400.0040.04515.32
5.4.390.0020.02815.18
5.4.380.0050.04215.23
5.4.370.0090.04015.33
5.4.360.0050.04015.24
5.4.350.0070.04215.15
5.4.340.0070.02215.29
5.4.330.0030.00311.35
5.4.320.0020.03714.97
5.4.310.0080.02515.13
5.4.300.0050.03715.04
5.4.290.0060.04315.31
5.4.280.0030.04415.20
5.4.270.0020.02315.00
5.4.260.0020.04515.20
5.4.250.0030.04515.09
5.4.240.0070.03015.27
5.4.230.0080.02815.22
5.4.220.0050.02715.33
5.4.210.0020.02415.23
5.4.200.0080.01615.06
5.4.190.0030.02515.13
5.4.180.0030.02315.05
5.4.170.0070.01815.19
5.4.160.0020.02415.15
5.4.150.0030.02415.12
5.4.140.0010.02413.69
5.4.130.0050.01813.69
5.4.120.0020.02313.76
5.4.110.0000.02213.89
5.4.100.0030.01813.93
5.4.90.0030.02213.89
5.4.80.0050.02213.76
5.4.70.0070.01813.78
5.4.60.0030.02213.67
5.4.50.0020.02113.91
5.4.40.0030.02313.83
5.4.30.0060.02113.69
5.4.20.0050.01713.72
5.4.10.0020.02413.78
5.4.00.0040.02013.56
5.3.290.0070.07014.73
5.3.280.0030.04014.54
5.3.270.0100.03314.63
5.3.260.0000.04014.72
5.3.250.0030.03714.58
5.3.240.0100.03314.63
5.3.230.0030.04014.59
5.3.220.0030.03314.71
5.3.210.0000.04014.55
5.3.200.0030.03714.68
5.3.190.0100.04714.55
5.3.180.0070.06014.59
5.3.170.0070.06014.63
5.3.160.0030.03714.62
5.3.150.0070.03314.65
5.3.140.0000.04014.54
5.3.130.0030.03714.66
5.3.120.0070.04014.66
5.3.110.0030.03714.56
5.3.100.0030.04014.03
5.3.90.0030.05714.13
5.3.80.0030.03313.95
5.3.70.0070.03313.95
5.3.60.0000.04013.99
5.3.50.0100.03013.93
5.3.40.0000.04313.95
5.3.30.0100.02713.93
5.3.20.0030.04713.72
5.3.10.0000.03313.71
5.3.00.0030.03313.73
5.2.170.0030.02711.27
5.2.160.0030.02711.25
5.2.150.0000.03311.25
5.2.140.0030.02311.25
5.2.130.0070.02011.25
5.2.120.0000.03311.25
5.2.110.0070.02311.25
5.2.100.0000.03011.25
5.2.90.0000.03011.25
5.2.80.0030.02711.25
5.2.70.0000.03011.25
5.2.60.0000.03011.25
5.2.50.0030.02711.25
5.2.40.0030.02711.25
5.2.30.0030.03011.25
5.2.20.0000.03011.25
5.2.10.0000.03011.25
5.2.00.0000.03011.25
5.1.60.0070.04311.25
5.1.50.0000.03011.25
5.1.40.0030.02311.25
5.1.30.0000.02711.25
5.1.20.0100.02011.25
5.1.10.0100.05011.25
5.1.00.0070.05011.25
5.0.50.0070.03711.25
5.0.40.0030.01711.25
5.0.30.0000.03711.25
5.0.20.0000.03311.25
5.0.10.0030.02311.25
5.0.00.0030.06311.25
4.4.90.0000.01711.25
4.4.80.0000.01311.25
4.4.70.0030.01311.25
4.4.60.0000.01311.25
4.4.50.0030.01311.25
4.4.40.0030.02011.25
4.4.30.0030.01311.25
4.4.20.0070.01711.25
4.4.10.0000.04011.25
4.4.00.0000.02711.25
4.3.110.0000.02011.25
4.3.100.0000.01711.25
4.3.90.0000.01311.25
4.3.80.0030.04711.25
4.3.70.0030.02711.25
4.3.60.0000.03311.25
4.3.50.0030.03311.25
4.3.40.0030.04711.25
4.3.30.0000.01711.25
4.3.20.0000.04011.25
4.3.10.0030.03011.25
4.3.00.0000.03311.25

preferences:
37.93 ms | 401 KiB | 5 Q