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]); return sprintf("%s %s", implode('-', $dateParts), implode('-', $timePrts)); } 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.0040.01518.80
8.3.50.0060.01016.46
8.3.40.0070.01118.93
8.3.30.0040.01119.04
8.3.20.0040.00420.25
8.3.10.0030.00721.89
8.3.00.0060.00319.56
8.2.180.0170.00318.79
8.2.170.0090.00622.96
8.2.160.0090.00619.09
8.2.150.0030.00524.18
8.2.140.0030.00624.66
8.2.130.0040.00421.13
8.2.120.0080.00026.35
8.2.110.0060.00321.16
8.2.100.0060.00619.82
8.2.90.0000.00819.13
8.2.80.0080.00018.05
8.2.70.0040.00717.88
8.2.60.0030.00517.93
8.2.50.0000.00818.10
8.2.40.0000.00920.59
8.2.30.0060.00320.98
8.2.20.0030.00518.17
8.2.10.0030.00518.18
8.2.00.0000.00718.13
8.1.280.0090.00925.92
8.1.270.0080.00023.92
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0060.00322.68
8.1.230.0120.00019.20
8.1.220.0040.00417.91
8.1.210.0030.00618.77
8.1.200.0040.00417.60
8.1.190.0050.00317.48
8.1.180.0000.00818.10
8.1.170.0070.00019.09
8.1.160.0050.00319.09
8.1.150.0030.00620.71
8.1.140.0000.00821.38
8.1.130.0040.00418.89
8.1.120.0040.00417.67
8.1.110.0000.00817.51
8.1.100.0040.00417.61
8.1.90.0040.00417.61
8.1.80.0040.00417.55
8.1.70.0030.00317.49
8.1.60.0050.00317.79
8.1.50.0000.00817.68
8.1.40.0040.00417.59
8.1.30.0080.00017.74
8.1.20.0080.00017.89
8.1.10.0000.00817.75
8.1.00.0000.00717.68
8.0.300.0060.00320.31
8.0.290.0040.00417.00
8.0.280.0030.00518.36
8.0.270.0000.00717.26
8.0.260.0000.00718.67
8.0.250.0030.00317.15
8.0.240.0070.00017.07
8.0.230.0000.00717.08
8.0.220.0000.00717.05
8.0.210.0050.00317.10
8.0.200.0070.00017.16
8.0.190.0080.00317.15
8.0.180.0040.00417.02
8.0.170.0000.00717.03
8.0.160.0050.00317.05
8.0.150.0050.00216.96
8.0.140.0040.00416.96
8.0.130.0030.00313.44
8.0.120.0050.00316.96
8.0.110.0040.00416.93
8.0.100.0040.00417.08
8.0.90.0000.00716.94
8.0.80.0030.01716.97
8.0.70.0040.00417.15
8.0.60.0040.00416.99
8.0.50.0040.00417.20
8.0.30.0090.01017.35
8.0.20.0140.00817.40
8.0.10.0040.00417.27
8.0.00.0060.01216.88
7.4.330.0080.00015.55
7.4.320.0060.00016.77
7.4.300.0030.00316.67
7.4.290.0070.00016.60
7.4.280.0040.00416.79
7.4.270.0000.00816.68
7.4.260.0080.00016.73
7.4.250.0030.00316.70
7.4.240.0040.00416.70
7.4.230.0040.00416.93
7.4.220.0060.01216.85
7.4.210.0030.01316.77
7.4.200.0070.00016.70
7.4.160.0140.00516.75
7.4.150.0120.00617.40
7.4.140.0130.00717.86
7.4.130.0120.00616.72
7.4.120.0060.01316.76
7.4.110.0100.00716.60
7.4.100.0060.01116.66
7.4.90.0140.00516.71
7.4.80.0090.01319.39
7.4.70.0100.00716.87
7.4.60.0100.00716.85
7.4.50.0060.00916.46
7.4.40.0090.01516.59
7.4.30.0060.01016.79
7.4.00.0070.00715.07
7.3.330.0050.00013.57
7.3.320.0000.00513.43
7.3.310.0040.00416.64
7.3.300.0070.00016.56
7.3.290.0090.00716.62
7.3.280.0090.01016.60
7.3.270.0130.00917.40
7.3.260.0130.01116.59
7.3.250.0100.00816.65
7.3.240.0160.00216.69
7.3.230.0040.01316.49
7.3.210.0090.00916.46
7.3.200.0130.00316.62
7.3.190.0130.00416.67
7.3.180.0030.01316.57
7.3.170.0120.00616.50
7.3.160.0100.00516.63
7.3.10.0000.01416.63
7.3.00.0060.00616.95
7.2.330.0090.00916.81
7.2.320.0120.00616.90
7.2.310.0000.01716.77
7.2.300.0060.01016.54
7.2.290.0150.00916.69
7.2.130.0040.01116.67
7.2.120.0000.00916.78
7.2.110.0080.00317.11
7.2.100.0100.00317.08
7.2.90.0030.01016.82
7.2.80.0000.00817.00
7.2.70.0000.00916.82
7.2.60.0070.00716.97
7.2.50.0030.01117.13
7.2.40.0070.00716.80
7.2.30.0100.00316.97
7.2.20.0000.01316.89
7.2.10.0030.00717.00
7.2.00.0020.01518.38
7.1.250.0040.00415.98
7.1.200.0100.01015.71
7.1.100.0070.00718.46
7.1.70.0130.00917.23
7.1.60.0470.00435.19
7.1.50.0280.02135.13
7.1.40.0210.01534.69
7.1.30.0200.01634.76
7.1.20.0260.00934.83
7.1.10.0090.01316.51
7.1.00.0070.01516.92
7.0.200.0070.01516.59
7.0.190.0090.01116.82
7.0.180.0030.01616.36
7.0.170.0120.00616.37
7.0.160.0110.00816.48
7.0.150.0170.00316.34
7.0.140.0150.00616.59
7.0.130.0090.01216.61
7.0.120.0120.00616.64
7.0.110.0030.02116.64
7.0.100.0100.01016.53
7.0.90.0040.01216.71
7.0.80.0000.01616.59
7.0.70.0030.01616.45
7.0.60.0090.01116.56
7.0.50.0100.01016.45
7.0.40.0030.01516.75
7.0.30.0120.00916.88
7.0.20.0100.00616.55
7.0.10.0060.00916.59
7.0.00.0060.00916.80

preferences:
42.15 ms | 400 KiB | 5 Q