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})/'; $filename = ltrim($filename, 'PX'); 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(implode('-', $dateParts)); $dateTime->setTime(implode(':', $timeParts)); 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.0150.00018.56
8.3.50.0100.01316.88
8.3.40.0150.00019.34
8.3.30.0180.00419.13
8.3.20.0040.00420.29
8.3.10.0030.00721.91
8.3.00.0080.00019.67
8.2.180.0170.00717.00
8.2.170.0120.00322.96
8.2.160.0000.01519.37
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00419.02
8.2.120.0050.00326.35
8.2.110.0060.00619.38
8.2.100.0060.00618.02
8.2.90.0000.00819.36
8.2.80.0000.00918.05
8.2.70.0040.00818.13
8.2.60.0050.00318.03
8.2.50.0000.00818.16
8.2.40.0000.00720.59
8.2.30.0090.00021.15
8.2.20.0000.00718.18
8.2.10.0040.00418.09
8.2.00.0040.00418.21
8.1.280.0000.01525.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00921.37
8.1.230.0000.01219.03
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0030.00617.60
8.1.190.0050.00317.50
8.1.180.0000.00818.10
8.1.170.0000.00718.86
8.1.160.0050.00319.11
8.1.150.0030.00618.95
8.1.140.0080.00019.53
8.1.130.0000.00718.81
8.1.120.0000.00717.70
8.1.110.0080.00017.64
8.1.100.0050.00217.80
8.1.90.0000.00917.82
8.1.80.0050.00217.75
8.1.70.0030.00317.78
8.1.60.0030.00517.79
8.1.50.0040.00417.71
8.1.40.0040.00417.77
8.1.30.0000.00917.97
8.1.20.0030.00617.87
8.1.10.0000.00817.81
8.1.00.0030.00617.93
8.0.300.0000.00820.11
8.0.290.0040.00417.13
8.0.280.0040.00418.50
8.0.270.0030.00317.30
8.0.260.0000.00718.86
8.0.250.0000.00717.33
8.0.240.0000.00717.22
8.0.230.0070.00017.23
8.0.220.0030.00317.17
8.0.210.0040.00417.21
8.0.200.0030.00317.38
8.0.190.0060.00317.32
8.0.180.0000.00817.30
8.0.170.0070.00017.32
8.0.160.0000.00717.25
8.0.150.0040.00417.08
8.0.140.0040.00417.24
8.0.130.0000.00513.62
8.0.120.0050.00317.23
8.0.110.0070.00017.27
8.0.100.0000.00717.26
8.0.90.0000.00717.25
8.0.80.0030.01317.14
8.0.70.0050.00317.07
8.0.60.0000.00717.32
8.0.50.0050.00217.25
8.0.30.0150.00717.40
8.0.20.0090.01217.48
8.0.10.0000.00717.27
8.0.00.0100.00716.98
7.4.330.0000.00615.55
7.4.320.0040.00416.79
7.4.300.0000.00616.86
7.4.290.0000.00716.97
7.4.280.0000.00916.93
7.4.270.0030.00316.96
7.4.260.0000.00816.94
7.4.250.0040.00416.82
7.4.240.0040.00416.85
7.4.230.0000.00716.89
7.4.220.0060.01516.88
7.4.210.0060.00916.96
7.4.200.0030.00316.94
7.4.160.0090.00816.91
7.4.150.0120.00617.40
7.4.140.0130.00617.86
7.4.130.0150.00916.95
7.4.120.0120.00816.98
7.4.110.0130.00317.03
7.4.100.0180.00617.04
7.4.90.0000.01816.92
7.4.80.0120.00619.39
7.4.70.0030.01416.72
7.4.60.0070.01116.80
7.4.50.0130.00017.06
7.4.40.0110.01117.04
7.4.30.0130.00416.86
7.4.00.0030.01215.45
7.3.330.0000.00513.68
7.3.320.0000.00513.66
7.3.310.0030.00316.58
7.3.300.0040.00216.57
7.3.290.0050.01016.68
7.3.280.0100.00816.67
7.3.270.0150.00317.40
7.3.260.0150.01616.65
7.3.250.0070.01216.70
7.3.240.0080.01016.71
7.3.230.0100.00717.10
7.3.210.0070.01116.73
7.3.200.0060.01216.81
7.3.190.0130.00316.79
7.3.180.0090.01316.80
7.3.170.0030.01316.79
7.3.160.0080.00816.69
7.3.120.0070.01015.02
7.3.110.0140.00315.38
7.3.100.0100.00715.18
7.3.90.0070.01014.96
7.3.80.0080.00415.18
7.3.70.0030.01014.87
7.3.60.0040.01114.97
7.3.50.0040.01415.15
7.3.40.0150.00015.18
7.3.30.0030.01015.16
7.3.20.0060.01017.02
7.3.10.0080.00616.72
7.3.00.0030.01217.11
7.2.330.0090.00917.05
7.2.320.0090.00916.83
7.2.310.0130.00416.91
7.2.300.0100.00716.93
7.2.290.0080.00817.09
7.2.250.0060.01215.14
7.2.240.0030.01715.43
7.2.230.0070.00715.32
7.2.220.0120.00015.31
7.2.210.0070.00415.41
7.2.200.0120.00315.12
7.2.190.0100.00715.33
7.2.180.0100.00715.05
7.2.170.0090.00614.99
7.2.130.0130.00317.22
7.2.120.0060.00617.11
7.2.110.0070.01117.01
7.2.100.0070.00717.05
7.2.90.0060.00617.20
7.2.80.0040.01417.29
7.2.70.0070.01017.12
7.2.60.0110.00617.28
7.2.50.0050.00917.09
7.2.40.0070.00717.19
7.2.30.0070.00317.20
7.2.20.0000.01517.36
7.2.10.0030.01317.24
7.2.00.0020.01218.31
7.1.330.0000.01716.13
7.1.320.0100.00316.16
7.1.310.0080.00316.18
7.1.300.0040.01115.65
7.1.290.0100.00315.92
7.1.280.0040.01116.14
7.1.270.0090.00616.04
7.1.260.0100.00316.07
7.1.250.0060.01016.01
7.1.200.0030.01015.90
7.1.100.0060.00618.54
7.1.70.0140.00717.62
7.1.60.0270.02635.36
7.1.50.0270.02435.21
7.1.40.0230.02334.85
7.1.30.0440.01434.88
7.1.20.0400.01734.70
7.1.10.0100.01016.86
7.1.00.0140.00617.15
7.0.200.0100.01017.20
7.0.190.0130.00616.96
7.0.180.0030.01716.71
7.0.170.0110.01416.54
7.0.160.0150.00616.75
7.0.150.0070.01016.47
7.0.140.0070.01016.63
7.0.130.0120.00916.89
7.0.120.0120.00316.79
7.0.110.0180.00516.89
7.0.100.0120.00916.56
7.0.90.0030.01816.64
7.0.80.0090.00916.84
7.0.70.0030.01616.42
7.0.60.0060.01316.50
7.0.50.0070.01316.67
7.0.40.0080.01216.93
7.0.30.0070.01016.85
7.0.20.0030.01616.66
7.0.10.0100.01116.73
7.0.00.0110.00916.80

preferences:
104.59 ms | 400 KiB | 5 Q