3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = '#^/(?<owner>[^/]+)/(?<tournament>[^/]+)/(?<league>[^/]+)/(?<team1>[^/\-]+)\-(?<team1_number>\d+)_(?<team2>[^_\-]+)\-(?<team2_number>\d+)(?:\.(?<_format>html|xml|json))?$#s'; // 0.0165 ms avg $optRegex = '#^/(?<owner>[^/]++)/(?<tournament>[^/]++)/(?<league>[^/]++)/(?<team1>[^/\-]++)\-(?<team1_number>\d++)_(?<team2>[^_\-]++)\-(?<team2_number>\d++)(?:\.(?<_format>html|xml|json))?$#s'; // 0.02 ms avg // only needs 82.5% of the time $totaltime = 0; $matches = array(); for ($i = 0; $i < 1000; $i++) { $t = microtime(true); preg_match($regex, '/username/my-tournament', $matches); preg_match($regex, '/username/my-tournament/premier-league', $matches); preg_match($regex, '/username/my-tournament/premier-league/matches', $matches); preg_match($regex, '/username/my-tournament/premier-league/ABC-A_CBA-B', $matches); preg_match($regex, '/username/my-tournament/premier-league/ABC-1_CBA-2.pdf', $matches); preg_match($regex, '/username/my-tournament/premier-league/ABC-1_CBA-2', $matches); $time = ((microtime(true) - $t) * 1000); $totaltime += $time; } echo sprintf('%.4f ms avg', $totaltime / 1000);

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)
7.2.00.0000.01619.41
7.1.70.0100.01317.43
7.1.60.0030.01719.17
7.1.50.0000.01417.16
7.1.00.0030.03322.39
7.0.200.0030.00716.82
7.0.140.0100.06722.18
7.0.110.0130.05719.91
7.0.100.0100.07720.01
7.0.90.0070.10020.07
7.0.80.0100.07719.97
7.0.70.0070.08319.92
7.0.60.0030.09020.05
7.0.50.0170.07019.99
7.0.40.0070.08019.71
7.0.30.0030.09019.85
7.0.20.0100.08319.71
7.0.10.0030.07719.66
7.0.00.0070.06719.65
5.6.280.0030.08721.10
5.6.260.0030.09720.67
5.6.250.0030.09020.61
5.6.240.0170.04720.86
5.6.230.0100.05720.69
5.6.220.0130.08020.64
5.6.210.0030.09320.61
5.6.200.0100.08720.55
5.6.190.0030.10020.59
5.6.180.0030.06320.66
5.6.170.0070.05720.70
5.6.160.0170.07320.55
5.6.150.0030.09020.65
5.6.140.0030.08320.68
5.6.130.0030.06720.70
5.6.120.0000.09320.61
5.6.110.0070.07720.55
5.6.100.0100.08320.68
5.6.90.0000.05020.50
5.6.80.0130.08319.98
5.6.70.0130.07720.22
5.6.60.0070.07720.01
5.6.50.0030.08720.02
5.6.40.0030.08319.98
5.6.30.0070.06320.00
5.6.20.0070.09019.91
5.6.10.0100.07020.05
5.6.00.0070.05320.01
5.5.380.0070.08717.41
5.5.370.0070.08717.55
5.5.360.0000.08017.49
5.5.350.0030.05317.62
5.5.340.0170.08318.13
5.5.330.0030.09018.03
5.5.320.0130.08318.10
5.5.310.0100.08718.09
5.5.300.0030.07018.09
5.5.290.0100.08717.86
5.5.280.0070.09318.26
5.5.270.0130.08017.84
5.5.260.0030.05018.13
5.5.250.0030.06718.06
5.5.240.0030.08317.15
5.5.230.0130.07717.24
5.5.220.0070.08317.38
5.5.210.0000.08717.27
5.5.200.0070.08717.20
5.5.190.0100.07717.38
5.5.180.0100.06717.36
5.5.160.0030.08017.19
5.5.150.0030.04717.23
5.5.140.0100.05717.22
5.5.130.0030.06017.46
5.5.120.0130.05317.47
5.5.110.0070.08317.19
5.5.100.0070.08317.35
5.5.90.0170.04717.11
5.5.80.0100.05317.10
5.5.70.0100.08317.37
5.5.60.0070.09717.13
5.5.50.0030.06317.34
5.5.40.0070.08717.50
5.5.30.0070.08017.22
5.5.20.0100.07717.08
5.5.10.0000.09017.10
5.5.00.0000.09016.99
5.4.450.0170.05319.36
5.4.440.0030.05319.35
5.4.430.0100.06319.42
5.4.420.0100.04019.27
5.4.410.0200.05719.30
5.4.400.0070.08718.99
5.4.390.0030.08719.00
5.4.380.0130.08719.00
5.4.370.0070.04019.00
5.4.360.0030.08718.97
5.4.350.0100.05719.16
5.4.340.0070.09019.18
5.4.320.0030.07319.03
5.4.310.0030.09319.01
5.4.300.0100.09019.12
5.4.290.0100.08719.07
5.4.280.0100.09018.98
5.4.270.0100.08719.17
5.4.260.0070.04719.14
5.4.250.0070.08719.13
5.4.240.0070.08718.90
5.4.230.0070.08319.02
5.4.220.0130.08318.89
5.4.210.0130.06019.11
5.4.200.0130.08319.02
5.4.190.0070.05719.01
5.4.180.0030.05319.02
5.4.170.0030.09319.02
5.4.160.0100.05019.07
5.4.150.0000.06319.14
5.4.140.0100.07316.23
5.4.130.0030.08716.19
5.4.120.0100.07716.16
5.4.110.0130.07316.49
5.4.100.0030.08316.49
5.4.90.0030.09016.40
5.4.80.0070.08316.54
5.4.70.0100.07716.17
5.4.60.0070.09016.48
5.4.50.0100.08016.50
5.4.40.0170.07016.31
5.4.30.0070.08016.50
5.4.20.0070.08316.40
5.4.10.0070.09316.34
5.4.00.0070.05015.93
5.3.290.0070.09014.69
5.3.280.0030.05314.50
5.3.270.0070.08714.51
5.3.260.0030.09314.50
5.3.250.0030.09314.45
5.3.240.0000.09314.62
5.3.230.0030.06014.49
5.3.220.0100.08714.40
5.3.210.0100.06014.58
5.3.200.0100.08314.40
5.3.190.0070.05714.36
5.3.180.0130.05014.51
5.3.170.0030.09314.43
5.3.160.0070.05714.59
5.3.150.0070.06314.41
5.3.140.0170.07714.63
5.3.130.0000.08014.46
5.3.120.0130.08014.57
5.3.110.0070.05714.43
5.3.100.0100.08714.11
5.3.90.0070.08713.93
5.3.80.0030.09014.08
5.3.70.0030.09013.98
5.3.60.0100.05013.87
5.3.50.0000.08714.01
5.3.40.0100.06014.04
5.3.30.0000.04713.98
5.3.20.0030.05313.75
5.3.10.0000.04713.66
5.3.00.0030.07013.43
5.2.170.0030.07312.73
5.2.160.0030.07312.73
5.2.150.0070.05012.73
5.2.140.0070.04712.73
5.2.130.0070.05012.73
5.2.120.0070.06712.73
5.2.110.0100.03012.73
5.2.100.0070.06312.73
5.2.90.0100.03012.73
5.2.80.0030.05012.73
5.2.70.0030.03712.73
5.2.60.0000.06012.73
5.2.50.0100.06312.73
5.2.40.0030.07712.73
5.2.30.0100.07012.73
5.2.20.0070.05712.73
5.2.10.0070.04012.73
5.2.00.0070.03012.73
5.1.60.0070.02012.73
5.1.50.0030.02712.73
5.1.40.0030.03012.73
5.1.30.0000.03012.73
5.1.20.0000.03012.91
5.1.10.0030.02713.26
5.1.00.0030.04313.26
5.0.50.0000.04713.26
5.0.40.0030.02013.26
5.0.30.0000.04013.26
5.0.20.0000.04313.26
5.0.10.0070.04013.26
5.0.00.0100.06313.26
4.4.90.0000.03712.73
4.4.80.0000.05312.73
4.4.70.0030.05012.73
4.4.60.0000.03312.73
4.4.50.0030.02712.73
4.4.40.0070.05012.73
4.4.30.0030.03012.73
4.4.20.0000.01713.16
4.4.10.0000.01313.26
4.4.00.0030.05313.26
4.3.110.0030.01313.26
4.3.100.0000.02013.26
4.3.90.0070.02713.26
4.3.80.0070.04313.26
4.3.70.0030.03713.26
4.3.60.0070.03013.26
4.3.50.0030.03013.26
4.3.40.0000.05713.26
4.3.30.0030.01713.26
4.3.20.0000.02313.26
4.3.10.0030.03313.26
4.3.00.0030.01313.26

preferences:
38.02 ms | 401 KiB | 5 Q