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]); var_dump($dateParts); $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.0160.00318.68
8.3.50.0080.00816.39
8.3.40.0080.00819.27
8.3.30.0110.01119.09
8.3.20.0070.00020.34
8.3.10.0100.00021.95
8.3.00.0040.00419.79
8.2.180.0110.01116.88
8.2.170.0160.00022.96
8.2.160.0090.00619.39
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0080.00019.26
8.2.120.0070.00026.35
8.2.110.0030.00919.31
8.2.100.0030.01018.18
8.2.90.0080.00019.33
8.2.80.0080.00018.03
8.2.70.0050.00317.92
8.2.60.0000.00818.28
8.2.50.0060.00318.10
8.2.40.0060.00320.55
8.2.30.0050.00321.09
8.2.20.0040.00418.08
8.2.10.0040.00418.28
8.2.00.0000.00718.23
8.1.280.0070.00725.92
8.1.270.0040.00422.00
8.1.260.0000.00726.35
8.1.250.0050.00328.09
8.1.240.0060.00322.02
8.1.230.0080.00420.86
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0030.00617.60
8.1.190.0040.00417.36
8.1.180.0060.00318.10
8.1.170.0090.00018.89
8.1.160.0000.00719.08
8.1.150.0060.00320.61
8.1.140.0030.00519.61
8.1.130.0000.00918.94
8.1.120.0070.00017.79
8.1.110.0040.00417.68
8.1.100.0060.00317.78
8.1.90.0030.00517.83
8.1.80.0000.00717.68
8.1.70.0030.00317.65
8.1.60.0040.00417.84
8.1.50.0040.00417.82
8.1.40.0060.00317.81
8.1.30.0040.00417.92
8.1.20.0080.00017.80
8.1.10.0030.00617.75
8.1.00.0030.00717.76
8.0.300.0000.00821.77
8.0.290.0060.00317.00
8.0.280.0040.00418.47
8.0.270.0000.00717.23
8.0.260.0000.00817.11
8.0.250.0070.00017.12
8.0.240.0070.00017.24
8.0.230.0080.00017.25
8.0.220.0030.00317.10
8.0.210.0000.00817.25
8.0.200.0000.00617.23
8.0.190.0040.00417.22
8.0.180.0000.00717.10
8.0.170.0000.00717.21
8.0.160.0000.00817.16
8.0.150.0070.00017.13
8.0.140.0040.00417.15
8.0.130.0050.00013.49
8.0.120.0000.00717.04
8.0.110.0050.00217.12
8.0.100.0030.00517.01
8.0.90.0070.00017.09
8.0.80.0100.00717.13
8.0.70.0030.00516.98
8.0.60.0030.00517.09
8.0.50.0040.00417.00
8.0.30.0080.01017.46
8.0.20.0070.01317.49
8.0.10.0040.00417.23
8.0.00.0080.00817.03
7.4.330.0060.00015.55
7.4.320.0060.00016.95
7.4.300.0060.00016.91
7.4.290.0000.00716.98
7.4.280.0000.00716.87
7.4.270.0050.00216.75
7.4.260.0040.00416.97
7.4.250.0040.00416.90
7.4.240.0040.00416.85
7.4.230.0070.00016.86
7.4.220.0090.00916.86
7.4.210.0040.01216.96
7.4.200.0000.00816.70
7.4.160.0080.00916.71
7.4.150.0140.01117.40
7.4.140.0100.00817.86
7.4.130.0090.00916.82
7.4.120.0070.01216.84
7.4.110.0100.00716.94
7.4.100.0250.00016.88
7.4.90.0120.00516.75
7.4.80.0100.01019.39
7.4.70.0140.00316.90
7.4.60.0130.01016.88
7.4.50.0060.00616.79
7.4.40.0100.00717.01
7.4.30.0090.00816.86
7.4.00.0060.00815.20
7.3.330.0050.00013.64
7.3.320.0060.00013.64
7.3.310.0030.00316.56
7.3.300.0020.00516.67
7.3.290.0040.01416.68
7.3.280.0070.01116.66
7.3.270.0120.00617.40
7.3.260.0180.02016.68
7.3.250.0120.00516.73
7.3.240.0090.01216.86
7.3.230.0060.01116.61
7.3.210.0190.00016.71
7.3.200.0090.01216.61
7.3.190.0070.01016.69
7.3.180.0130.00316.73
7.3.170.0060.01016.82
7.3.160.0070.01016.79
7.3.120.0100.00715.28
7.3.110.0090.00614.83
7.3.100.0040.01215.28
7.3.90.0100.00015.30
7.3.80.0090.00315.16
7.3.70.0040.01115.15
7.3.60.0080.00814.95
7.3.50.0070.00715.18
7.3.40.0140.00015.11
7.3.30.0040.01415.13
7.3.20.0060.00817.00
7.3.10.0070.01117.08
7.3.00.0070.00816.90
7.2.330.0120.00616.92
7.2.320.0030.01816.75
7.2.310.0100.00716.87
7.2.300.0170.00016.86
7.2.290.0090.00616.80
7.2.250.0140.00015.16
7.2.240.0120.00914.94
7.2.230.0090.00615.05
7.2.220.0060.00615.16
7.2.210.0060.00915.34
7.2.200.0070.00714.97
7.2.190.0030.01215.27
7.2.180.0030.01315.19
7.2.170.0040.01415.32
7.2.130.0070.00717.30
7.2.120.0040.01416.96
7.2.110.0070.01017.04
7.2.100.0040.00816.95
7.2.90.0120.00317.07
7.2.80.0120.00317.28
7.2.70.0030.01017.00
7.2.60.0090.00816.95
7.2.50.0000.01416.99
7.2.40.0040.01117.14
7.2.30.0090.00617.14
7.2.20.0070.01117.12
7.2.10.0000.01417.11
7.2.00.0090.00518.55
7.1.330.0090.00615.93
7.1.320.0110.00416.14
7.1.310.0060.00915.95
7.1.300.0100.00316.11
7.1.290.0000.01716.13
7.1.280.0070.01116.15
7.1.270.0030.00915.84
7.1.260.0100.00316.05
7.1.250.0040.01116.19
7.1.200.0000.01416.11
7.1.100.0070.00718.38
7.1.70.0120.00917.45
7.1.60.0290.01535.46
7.1.50.0390.01135.22
7.1.40.0350.01034.80
7.1.30.0250.01634.77
7.1.20.0240.02235.02
7.1.10.0120.01017.14
7.1.00.0100.00717.32
7.0.200.0140.00516.84
7.0.190.0130.01216.96
7.0.180.0090.00916.39
7.0.170.0030.01516.80
7.0.160.0120.00916.54
7.0.150.0070.01316.57
7.0.140.0040.01116.62
7.0.130.0090.00616.80
7.0.120.0040.01416.77
7.0.110.0060.01216.94
7.0.100.0060.01516.56
7.0.90.0080.01216.73
7.0.80.0090.00816.88
7.0.70.0110.01116.59
7.0.60.0090.01316.32
7.0.50.0090.01316.64
7.0.40.0030.01316.89
7.0.30.0060.01216.60
7.0.20.0000.01616.95
7.0.10.0100.00616.70
7.0.00.0100.01016.93

preferences:
38.14 ms | 401 KiB | 5 Q