3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filenameNew = 'PX20170713_103320_2651093_00001'; $filenameOld = '5956e5781e4f1-20170630_233347_5712837_00001.xml'; //$timeslug = implode(array_slice(explode('_', rtrim(basename($fileToProcess), ".xml" )), 0, 2)); //$datetime = date('c', strtotime($timeslug)); /** * Get a date time object from an AX filename. * * Example filename: PX20170713_103320_2651093_00001.xml * * If this fails it will throw an appropriate exception to * be handled gracefully. */ function getDateFromFilename(string $filename) { $dateRegexp = '/([0-9]{4})([0-9]{2})([0-9]{2})/'; $timeRegexp = '/([0-9]{2})([0-9]{2})([0-9]{2})/'; list($date, $time) = explode('_', $filename); preg_match($dateRegexp, $date, $dateParts); unset($dateParts[0]); preg_match($timeRegexp, $time, $timeParts); unset($timeParts[0]); $dateTime = new \DateTime(); $dateTime->setDate($dateParts[1], $dateParts[2], $dateParts[3]); $dateTime->setTime($timeParts[1], $timeParts[2], $timeParts[3]); return $dateTime; } var_dump(getDateFromFilename($filenameNew));

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.68
8.3.50.0140.00716.43
8.3.40.0120.00319.22
8.3.30.0090.00619.21
8.3.20.0070.00020.20
8.3.10.0050.00521.79
8.3.00.0040.00419.53
8.2.180.0090.00918.79
8.2.170.0090.00622.96
8.2.160.0090.00919.21
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00019.33
8.2.120.0050.00226.35
8.2.110.0030.00622.39
8.2.100.0000.01218.34
8.2.90.0050.00318.16
8.2.80.0030.00618.04
8.2.70.0050.00318.05
8.2.60.0040.00718.11
8.2.50.0030.00618.10
8.2.40.0030.00619.45
8.2.30.0050.00321.13
8.2.20.0040.00418.04
8.2.10.0000.00717.97
8.2.00.0040.00418.09
8.1.280.0110.00725.92
8.1.270.0050.00522.19
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0030.00623.96
8.1.230.0080.00422.81
8.1.220.0000.00817.78
8.1.210.0030.00618.77
8.1.200.0000.00917.47
8.1.190.0050.00517.60
8.1.180.0030.00618.10
8.1.170.0000.00918.82
8.1.160.0020.00519.06
8.1.150.0100.00020.70
8.1.140.0040.00419.60
8.1.130.0000.01018.80
8.1.120.0000.00717.78
8.1.110.0070.00017.59
8.1.100.0050.00317.63
8.1.90.0040.00417.78
8.1.80.0040.00417.67
8.1.70.0030.00317.75
8.1.60.0000.00817.94
8.1.50.0000.00717.82
8.1.40.0080.00017.68
8.1.30.0030.00617.78
8.1.20.0030.00517.91
8.1.10.0040.00417.81
8.1.00.0060.00317.87
8.0.300.0040.00419.90
8.0.290.0040.00417.13
8.0.280.0030.00618.49
8.0.270.0030.00317.34
8.0.260.0000.00717.18
8.0.250.0030.00317.26
8.0.240.0000.00717.34
8.0.230.0000.00817.31
8.0.220.0000.00717.17
8.0.210.0000.00717.12
8.0.200.0000.00717.27
8.0.190.0080.00017.29
8.0.180.0040.00417.10
8.0.170.0070.00017.25
8.0.160.0040.00417.14
8.0.150.0030.00517.16
8.0.140.0040.00417.10
8.0.130.0000.00613.50
8.0.120.0030.00617.15
8.0.110.0000.00717.19
8.0.100.0030.00517.13
8.0.90.0080.00017.04
8.0.80.0110.00717.18
8.0.70.0070.00017.00
8.0.60.0030.00517.05
8.0.50.0000.00817.15
8.0.30.0100.00817.39
8.0.20.0110.00917.47
8.0.10.0000.00817.25
8.0.00.0040.01417.23
7.4.330.0070.00015.55
7.4.320.0000.00716.86
7.4.300.0000.00717.00
7.4.290.0000.00716.82
7.4.280.0030.00516.84
7.4.270.0000.00717.00
7.4.260.0000.00716.83
7.4.250.0050.00316.84
7.4.240.0040.00416.95
7.4.230.0030.00316.77
7.4.220.0090.00916.97
7.4.210.0080.01316.89
7.4.200.0000.00716.77
7.4.160.0120.00516.94
7.4.150.0060.01217.40
7.4.140.0060.01217.86
7.4.130.0050.01617.00
7.4.120.0080.01216.95
7.4.110.0130.00616.84
7.4.100.0030.02016.98
7.4.90.0110.00616.76
7.4.80.0060.01219.39
7.4.70.0060.01716.71
7.4.60.0080.01216.80
7.4.50.0090.00316.87
7.4.40.0030.01516.88
7.4.30.0110.00516.85
7.4.00.0070.00815.35
7.3.330.0020.00213.41
7.3.320.0030.00313.46
7.3.310.0000.00716.66
7.3.300.0000.00716.66
7.3.290.0050.01116.62
7.3.280.0090.00916.65
7.3.270.0120.00617.40
7.3.260.0220.01216.64
7.3.250.0090.01016.77
7.3.240.0110.00816.74
7.3.230.0110.01116.71
7.3.210.0030.01416.78
7.3.200.0100.00716.77
7.3.190.0140.00316.85
7.3.180.0100.00716.90
7.3.170.0110.00516.74
7.3.160.0070.01316.86
7.3.120.0030.01514.98
7.3.110.0070.01214.96
7.3.100.0030.01315.06
7.3.90.0060.01115.16
7.3.80.0030.00915.09
7.3.70.0070.00614.98
7.3.60.0040.00915.08
7.3.50.0050.01015.11
7.3.40.0050.00915.00
7.3.30.0040.00415.07
7.3.20.0040.00916.99
7.3.10.0080.00617.03
7.3.00.0080.00716.96
7.2.330.0140.00417.02
7.2.320.0130.01017.17
7.2.310.0040.01216.79
7.2.300.0100.00616.84
7.2.290.0140.00317.16
7.2.250.0020.01715.44
7.2.240.0080.01115.36
7.2.230.0050.01115.36
7.2.220.0070.00915.30
7.2.210.0050.00715.40
7.2.200.0040.01115.54
7.2.190.0050.01015.37
7.2.180.0070.00815.38
7.2.170.0080.00715.29
7.2.60.0100.00317.20
7.2.00.0030.01020.02
7.1.330.0050.00916.01
7.1.320.0070.00416.10
7.1.310.0030.01116.16
7.1.300.0050.00915.99
7.1.290.0070.00916.08
7.1.280.0030.01015.95
7.1.270.0060.00516.14
7.1.260.0020.01016.14
7.1.200.0030.01016.02
7.1.100.0030.00918.81
7.1.70.0110.01117.70
7.1.60.0300.01335.61
7.1.50.0190.01735.12
7.1.40.0370.01234.99
7.1.30.0270.01835.11
7.1.20.0310.01635.01
7.1.10.0070.01317.06
7.1.00.0060.01217.15
7.0.200.0150.00417.25
7.0.190.0070.01017.16
7.0.180.0100.00916.70
7.0.170.0130.01816.85
7.0.160.0140.00816.50
7.0.150.0130.00616.52
7.0.140.0060.01316.70
7.0.130.0070.01316.84
7.0.120.0100.01016.98
7.0.110.0120.00816.61
7.0.100.0100.00816.59
7.0.90.0070.01516.71
7.0.80.0060.01216.96
7.0.70.0100.00716.74
7.0.60.0040.01416.35
7.0.50.0190.00616.78
7.0.40.0050.01616.98
7.0.30.0120.00817.05
7.0.20.0100.00716.95
7.0.10.0030.01616.80
7.0.00.0070.01116.92

preferences:
50.11 ms | 401 KiB | 5 Q