3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filename1 = "Ruggeri, Nichole M. - 10-21-2014.pdf"; $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($date_arr[0], 2, '0', STR_PAD_LEFT); $day = str_pad($date_arr[1], 2, '0', STR_PAD_LEFT); $year = $date_arr[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 $filename; } echo validate_date($filename1) . "<br>\n"; echo validate_date($filename2) . "<br>\n"; echo validate_date($filename3) . "<br>\n"; //print_r (validate_date($filename1)); //print_r (validate_date($filename2)); //print_r (validate_date($filename3)); ?>

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.0140.00718.55
8.3.50.0140.00722.18
8.3.40.0090.00618.92
8.3.30.0110.00319.22
8.3.20.0070.00020.39
8.3.10.0060.00323.66
8.3.00.0050.00319.50
8.2.180.0090.00616.63
8.2.170.0070.01122.96
8.2.160.0100.00320.45
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0050.00520.54
8.2.110.0060.00320.38
8.2.100.0120.00017.75
8.2.90.0080.00019.43
8.2.80.0050.00317.97
8.2.70.0030.00517.75
8.2.60.0000.00818.05
8.2.50.0040.00418.07
8.2.40.0040.00717.79
8.2.30.0080.00018.28
8.2.20.0040.00417.96
8.2.10.0000.00718.18
8.2.00.0030.00517.94
8.1.280.0000.01825.92
8.1.270.0060.00322.19
8.1.260.0000.00726.35
8.1.250.0000.00828.09
8.1.240.0030.00723.92
8.1.230.0090.00317.48
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0100.00017.48
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0000.00818.77
8.1.160.0080.00022.12
8.1.150.0040.00418.85
8.1.140.0040.00417.63
8.1.130.0000.00717.88
8.1.120.0050.00217.61
8.1.110.0040.00417.57
8.1.100.0040.00417.52
8.1.90.0040.00417.64
8.1.80.0000.00817.65
8.1.70.0030.00317.63
8.1.60.0060.00317.75
8.1.50.0040.00417.58
8.1.40.0030.00617.70
8.1.30.0040.00417.66
8.1.20.0000.00817.71
8.1.10.0000.00717.74
8.1.00.0080.00017.66
8.0.300.0040.00418.77
8.0.290.0000.00717.00
8.0.280.0070.00018.43
8.0.270.0040.00417.30
8.0.260.0030.00317.29
8.0.250.0070.00017.03
8.0.240.0000.00817.12
8.0.230.0040.00417.02
8.0.220.0030.00317.05
8.0.210.0040.00417.10
8.0.200.0000.00717.11
8.0.190.0060.00317.12
8.0.180.0040.00417.10
8.0.170.0030.00617.14
8.0.160.0040.00417.12
8.0.150.0070.00017.04
8.0.140.0000.00717.01
8.0.130.0060.00013.58
8.0.120.0000.00816.93
8.0.110.0040.00417.09
8.0.100.0060.00317.02
8.0.90.0030.00516.93
8.0.80.0070.01017.03
8.0.70.0040.00417.13
8.0.60.0040.00417.06
8.0.50.0000.00717.06
8.0.30.0090.01117.21
8.0.20.0160.01017.40
8.0.10.0030.00617.13
8.0.00.0090.00916.96
7.4.330.0050.00015.00
7.4.320.0030.00316.83
7.4.300.0070.00016.88
7.4.290.0000.00816.73
7.4.280.0030.01016.81
7.4.270.0000.00716.77
7.4.260.0040.00416.82
7.4.250.0000.00816.60
7.4.240.0030.00516.79
7.4.230.0040.00416.64
7.4.220.0170.00516.77
7.4.210.0070.00716.95
7.4.200.0000.00916.75
7.4.160.0110.00516.77
7.4.150.0120.00917.40
7.4.140.0150.00517.86
7.4.130.0110.00616.83
7.4.120.0120.00616.64
7.4.110.0070.01116.75
7.4.100.0110.00716.65
7.4.90.0030.01316.82
7.4.80.0110.00519.39
7.4.70.0030.01316.50
7.4.60.0070.01016.82
7.4.50.0040.00416.74
7.4.40.0120.01216.93
7.4.30.0100.00916.79
7.4.10.0040.01515.32
7.4.00.0050.01215.14
7.3.330.0000.00613.25
7.3.320.0000.00513.54
7.3.310.0000.00816.57
7.3.300.0000.00816.57
7.3.290.0030.01216.40
7.3.280.0070.01116.47
7.3.270.0100.01017.40
7.3.260.0090.00916.56
7.3.250.0090.00916.56
7.3.240.0120.00916.67
7.3.230.0100.00616.64
7.3.210.0080.00816.54
7.3.200.0150.00619.39
7.3.190.0060.01216.64
7.3.180.0030.01216.82
7.3.170.0130.00316.47
7.3.160.0040.01216.57
7.3.130.0130.00515.36
7.3.120.0100.00914.97
7.3.110.0090.00714.98
7.3.100.0090.00514.91
7.3.90.0020.01215.06
7.3.80.0080.00515.13
7.3.70.0070.00814.94
7.3.60.0090.00715.01
7.3.50.0050.00814.92
7.3.40.0080.00314.96
7.3.30.0080.00414.89
7.3.20.0050.01016.74
7.3.10.0100.00716.65
7.3.00.0010.01016.86
7.2.330.0100.00716.85
7.2.320.0070.01116.88
7.2.310.0200.00416.83
7.2.300.0130.00316.90
7.2.290.0190.00416.99
7.2.260.0110.00415.09
7.2.250.0040.01415.25
7.2.240.0060.01215.31
7.2.230.0040.01015.20
7.2.220.0040.01015.29
7.2.210.0090.00715.12
7.2.200.0060.00715.36
7.2.190.0090.00615.35
7.2.180.0090.00415.15
7.2.170.0100.00415.09
7.2.160.0090.00815.16
7.2.150.0100.00517.02
7.2.140.0090.00417.00
7.2.130.0070.00517.21
7.2.120.0070.00617.08
7.2.110.0030.01516.83
7.2.100.0080.00816.96
7.2.90.0090.00517.16
7.2.80.0080.00516.96
7.2.70.0100.00717.06
7.2.60.0090.00516.89
7.2.50.0060.00617.15
7.2.40.0040.01117.13
7.2.30.0060.00717.16
7.2.20.0040.00817.03
7.2.10.0040.01116.87
7.2.00.0080.00717.99
7.1.330.0060.00915.98
7.1.320.0050.00915.89
7.1.310.0050.01015.79
7.1.300.0080.00516.05
7.1.290.0040.00916.06
7.1.280.0030.01016.06
7.1.270.0060.00715.99
7.1.260.0060.00915.88
7.1.250.0070.00616.01
7.1.240.0030.00616.19
7.1.230.0030.00915.95
7.1.220.0090.00615.98
7.1.210.0030.00715.96
7.1.200.0030.01015.79
7.1.190.0110.00816.19
7.1.180.0040.00816.18
7.1.170.0040.00816.01
7.1.160.0060.00315.99
7.1.150.0100.00316.14
7.1.140.0090.00615.87
7.1.130.0100.00315.95
7.1.120.0040.01116.14
7.1.110.0100.00015.91
7.1.100.0060.00617.14
7.1.90.0070.00716.19
7.1.80.0000.01216.04
7.1.70.0030.00916.65
7.1.60.0060.01117.66
7.1.50.0090.00716.56
7.1.40.0130.00316.00
7.1.30.0040.00816.10
7.1.20.0080.00815.77
7.1.10.0070.00415.86
7.1.00.0050.04019.29
7.0.330.0060.00615.63
7.0.320.0030.00915.71
7.0.310.0000.01315.58
7.0.300.0000.01115.69
7.0.290.0060.00615.59
7.0.280.0130.00615.71
7.0.270.0100.00515.33
7.0.260.0060.00615.39
7.0.250.0030.00815.52
7.0.240.0000.01515.46
7.0.230.0070.00715.73
7.0.220.0080.00415.75
7.0.210.0060.00615.51
7.0.200.0030.00716.35
7.0.190.0090.00615.75
7.0.180.0030.00615.75
7.0.170.0030.00715.70
7.0.160.0040.01115.27
7.0.150.0000.00815.31
7.0.140.0040.03718.93
7.0.130.0060.00315.62
7.0.120.0060.00315.50
7.0.110.0040.00715.75
7.0.100.0080.03017.75
7.0.90.0190.01917.81
7.0.80.0180.02817.79
7.0.70.0210.02317.72
7.0.60.0240.01617.79
7.0.50.0250.01818.03
7.0.40.0110.03516.84
7.0.30.0070.04216.93
7.0.20.0040.04816.94
7.0.10.0050.02216.94
7.0.00.0090.02516.88
5.6.400.0100.00314.14
5.6.390.0130.00014.41
5.6.380.0000.01314.39
5.6.370.0160.00014.12
5.6.360.0030.01314.56
5.6.350.0040.00914.57
5.6.340.0030.00614.60
5.6.330.0000.00814.73
5.6.320.0060.00914.79
5.6.310.0030.01214.23
5.6.300.0060.00314.67
5.6.290.0030.00614.66
5.6.280.0060.03917.65
5.6.270.0100.00314.24
5.6.260.0110.00314.44
5.6.250.0070.04517.55
5.6.240.0040.02317.55
5.6.230.0100.03517.56
5.6.220.0020.02217.61
5.6.210.0100.01717.75
5.6.200.0060.02317.67
5.6.190.0030.02117.70
5.6.180.0070.04217.76
5.6.170.0070.04217.83
5.6.160.0070.03817.81
5.6.150.0130.03017.60
5.6.140.0050.04317.77
5.6.130.0080.03217.79
5.6.120.0030.05017.70
5.6.110.0020.05217.69
5.6.100.0110.04117.84
5.6.90.0080.04317.75
5.6.80.0050.02017.40
5.6.70.0080.04017.36
5.6.60.0050.01817.29
5.6.50.0050.04517.57
5.6.40.0070.04217.37
5.6.30.0070.04517.32
5.6.20.0070.02017.34
5.6.10.0070.04017.35
5.6.00.0060.03517.49
5.5.380.0080.04017.40
5.5.370.0080.03317.45
5.5.360.0050.03717.33
5.5.350.0040.02117.43
5.5.340.0050.02317.49
5.5.330.0060.04217.43
5.5.320.0080.02117.44
5.5.310.0060.04817.63
5.5.300.0030.02117.61
5.5.290.0030.02217.74
5.5.280.0060.01917.48
5.5.270.0080.04317.57
5.5.260.0030.02417.65
5.5.250.0030.03017.42
5.5.240.0050.04517.26
5.5.230.0040.04317.33
5.5.220.0040.03617.20
5.5.210.0100.04317.18
5.5.200.0100.03617.36
5.5.190.0130.04217.35
5.5.180.0020.04617.33
5.5.170.0050.00514.39
5.5.160.0030.04117.33
5.5.150.0110.04117.17
5.5.140.0100.02817.10
5.5.130.0080.04117.16
5.5.120.0080.01617.16
5.5.110.0050.02217.17
5.5.100.0030.03717.17
5.5.90.0050.04217.28
5.5.80.0070.03917.21
5.5.70.0100.04017.26
5.5.60.0040.04217.21
5.5.50.0050.03917.04
5.5.40.0080.04017.19
5.5.30.0050.02717.05
5.5.20.0020.04517.04
5.5.10.0050.04317.13
5.5.00.0140.03517.19
5.4.450.0040.03916.04
5.4.440.0050.03716.04
5.4.430.0030.02015.88
5.4.420.0070.01816.02
5.4.410.0030.03415.96
5.4.400.0000.04815.77
5.4.390.0090.04015.81
5.4.380.0080.03515.73
5.4.370.0020.03915.81
5.4.360.0100.03215.86
5.4.350.0030.03715.76
5.4.340.0040.04015.89
5.4.330.0100.00012.58
5.4.320.0070.01715.82
5.4.310.0070.02215.85
5.4.300.0030.04415.86
5.4.290.0100.03915.88
5.4.280.0050.03515.85
5.4.270.0060.01515.81
5.4.260.0020.02615.86
5.4.250.0020.04015.85
5.4.240.0050.04115.83
5.4.230.0010.04615.81
5.4.220.0030.04415.86
5.4.210.0060.03315.81
5.4.200.0000.03115.90
5.4.190.0070.03315.72
5.4.180.0070.03815.86
5.4.170.0050.02515.74
5.4.160.0020.04315.84
5.4.150.0070.04315.72
5.4.140.0070.04014.38
5.4.130.0020.02014.47
5.4.120.0060.03514.45
5.4.110.0080.02814.48
5.4.100.0070.03914.53
5.4.90.0090.01814.48
5.4.80.0020.02414.44
5.4.70.0040.04014.50
5.4.60.0020.02014.46
5.4.50.0050.03714.47
5.4.40.0050.03714.54
5.4.30.0050.03714.48
5.4.20.0040.01814.49
5.4.10.0030.04714.45
5.4.00.0050.03214.22
5.3.290.0070.06714.73
5.3.280.0000.08014.74
5.3.270.0030.06014.62
5.3.260.0070.07714.54
5.3.250.0070.05014.56
5.3.240.0030.03014.53
5.3.230.0000.03314.58
5.3.220.0100.07014.68
5.3.210.0030.07714.60
5.3.200.0070.03314.53
5.3.190.0070.03714.63
5.3.180.0000.04314.62
5.3.170.0030.03314.62
5.3.160.0000.07714.68
5.3.150.0000.04314.66
5.3.140.0170.03714.58
5.3.130.0100.07714.47
5.3.120.0030.03314.61
5.3.110.0030.07714.54
5.3.100.0070.07014.16
5.3.90.0070.07314.08
5.3.80.0030.04713.91
5.3.70.0000.03314.00
5.3.60.0030.07013.98
5.3.50.0130.02014.06
5.3.40.0030.06314.01
5.3.30.0030.06714.04
5.3.20.0100.06313.61
5.3.10.0100.06713.54
5.3.00.0070.07313.65
5.2.170.0070.06011.06
5.2.160.0100.03011.25
5.2.150.0070.03711.25
5.2.140.0070.06311.26
5.2.130.0070.05711.02
5.2.120.0100.06311.13
5.2.110.0000.02711.15
5.2.100.0030.04311.01
5.2.90.0030.05711.13
5.2.80.0070.06011.16
5.2.70.0030.02711.03
5.2.60.0030.05710.98
5.2.50.0030.06711.07
5.2.40.0030.06711.07
5.2.30.0030.04711.04
5.2.20.0070.03710.91
5.2.10.0070.02010.78
5.2.00.0070.05710.76
5.1.60.0070.01710.35
5.1.50.0030.05710.35
5.1.40.0100.04710.35
5.1.30.0030.06010.47
5.1.20.0030.06010.48
5.1.10.0000.02310.35
5.1.00.0070.04710.35
5.0.50.0030.05010.35
5.0.40.0030.01710.35
5.0.30.0030.05010.35
5.0.20.0000.01710.35
5.0.10.0030.02310.35
5.0.00.0000.03310.35
4.4.90.0030.03310.35
4.4.80.0000.03710.35
4.4.70.0000.03710.35
4.4.60.0030.02010.35
4.4.50.0030.01010.35
4.4.40.0000.02010.35
4.4.30.0030.02310.35
4.4.20.0000.01310.35
4.4.10.0000.01710.35
4.4.00.0000.02010.35
4.3.110.0070.03010.35
4.3.100.0000.02310.35
4.3.90.0000.02010.35
4.3.80.0000.02710.35
4.3.70.0000.02710.35
4.3.60.0000.02710.35
4.3.50.0070.01710.35
4.3.40.0030.04710.35
4.3.30.0000.02310.35
4.3.20.0000.01710.35
4.3.10.0000.01710.35
4.3.00.0000.01710.35

preferences:
62.38 ms | 401 KiB | 5 Q