3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (PHP_VERSION != '5.3.6') { die("Incorrect version"); } function a($url) { preg_match('!(?:(\w+)://)?(?:(\w+)\:(\w+)@)?([^/:]+)?(?:\:(\d*))?([^#?]+)?(?:\?([^#]+))?(?:#(.+$))?!i', $url, $out); return $out; } function b($url) { $out = parse_url($url); return $out; } $i = 100000; $start = microtime(true); while (--$i) { $u[1] = a('example.com'); $u[2] = a('example.com/index.php'); $u[3] = a('example.com?foo=bar'); $u[4] = a('/index.php'); $u[5] = a('/index.php/?foo=bar'); $u[6] = a('?foo=bar'); } print_r($u); echo microtime(true) - $start . "\n"; $i = 100000; $start = microtime(true); while (--$i) { $u[1] = b('example.com'); $u[2] = b('example.com/index.php'); $u[3] = b('example.com?foo=bar'); $u[4] = b('/index.php'); $u[5] = b('/index.php/?foo=bar'); $u[6] = b('?foo=bar'); } print_r($u); echo microtime(true) - $start . "\n";

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.0040.00819.30
7.1.100.0060.00617.88
7.1.70.0060.00616.96
7.1.60.0030.01419.34
7.1.50.0000.02116.75
7.1.00.0030.07722.31
7.0.200.0030.00716.63
7.0.140.0070.05022.10
7.0.60.0030.06720.10
7.0.50.0030.06317.81
7.0.40.0030.08720.20
7.0.30.0330.05720.24
7.0.20.0200.04320.29
7.0.10.0030.05020.23
7.0.00.0030.05020.12
5.6.280.0100.06721.09
5.6.210.0170.06020.73
5.6.200.0000.08718.14
5.6.190.0130.03320.38
5.6.180.0070.04720.58
5.6.170.0300.06020.52
5.6.160.0070.08020.54
5.6.150.0070.04018.22
5.6.140.0030.04718.21
5.6.130.0100.07718.16
5.6.120.0130.04321.03
5.6.110.0000.08721.05
5.6.100.0100.05021.15
5.6.90.0070.06721.05
5.6.80.0070.08020.52
5.5.350.0300.07020.36
5.5.340.0100.05717.98
5.5.330.0100.08320.43
5.5.320.0370.07320.28
5.5.310.0130.04020.35
5.5.300.0130.07317.93
5.5.290.0030.04318.08
5.5.280.0030.08720.77
5.5.270.0100.08020.84
5.5.260.0170.07720.80
5.5.250.0100.08320.70
5.5.240.0030.05720.27
5.4.450.0470.05719.56
5.4.440.0770.04719.48
5.4.430.0100.05719.54
5.4.420.0070.05719.68
5.4.410.0100.05319.58
5.4.400.0100.05019.25
5.4.390.0130.04719.13
5.4.380.0030.06718.62
5.4.370.0270.04718.73
5.4.360.0230.06318.54
5.4.350.0100.04013.79
5.4.340.0030.04013.72
5.4.320.0070.04314.18
5.4.310.0130.04014.35
5.4.300.0230.03314.27
5.4.290.0100.03714.27
5.4.280.0130.04014.12
5.4.270.0130.03714.15
5.4.260.0100.04314.17
5.4.250.0100.04314.18
5.4.240.0130.03714.16
5.4.230.0070.04314.22
5.4.220.0100.03714.23
5.4.210.0130.03314.31
5.4.200.0170.03314.17
5.4.190.0070.04014.09
5.4.180.0030.04314.18
5.4.170.0100.04314.11
5.4.160.0100.04014.24
5.4.150.0170.03014.11
5.4.140.0100.04313.83
5.4.130.0070.05313.83
5.4.120.0170.04014.02
5.4.110.0030.04313.78
5.4.100.0170.03013.81
5.4.90.0100.04713.94
5.4.80.0100.03713.77
5.4.70.0070.04313.73
5.4.60.0100.03713.77
5.4.50.0070.04013.78
5.4.40.0170.03313.87
5.4.30.0100.04013.75
5.4.20.0170.03313.84
5.4.10.0170.03313.76
5.4.00.0130.03713.26
5.3.290.0230.03314.79
5.3.280.0070.04714.77
5.3.270.0230.03014.72
5.3.260.0070.05714.73
5.3.250.0100.04714.53
5.3.240.0130.04014.68
5.3.230.0130.04014.53
5.3.220.0130.03314.56
5.3.210.0130.04014.62
5.3.200.0070.04014.57
5.3.190.0170.03714.76
5.3.180.0170.03014.68
5.3.170.0100.03714.64
5.3.160.0130.03714.72
5.3.150.0170.03314.76
5.3.140.0170.04014.72
5.3.130.0230.03314.54
5.3.120.0130.04014.61
5.3.110.0130.03714.67
5.3.100.0130.03714.02
5.3.90.0170.03313.97
5.3.80.0100.04314.15
5.3.70.0200.03014.09
5.3.60.0201.62714.04
5.3.50.0100.05014.11
5.3.40.0170.03013.88
5.3.30.0130.03713.97
5.3.20.0130.04013.75
5.3.10.0230.03013.65
5.3.00.0070.04313.74
5.2.170.0070.03311.32
5.2.160.0130.03011.14
5.2.150.0130.02711.17
5.2.140.0070.03011.14
5.2.130.0070.03311.11
5.2.120.0030.03711.19
5.2.110.0130.02711.10
5.2.100.0170.02711.10
5.2.90.0070.03311.26
5.2.80.0170.02311.23
5.2.70.0000.04311.25
5.2.60.0000.03711.09
5.2.50.0100.03011.19
5.2.40.0100.03011.16
5.2.30.0070.03311.03
5.2.20.0130.03011.00
5.2.10.0070.03310.80
5.2.00.0070.03710.71
5.1.60.0130.02710.15
5.1.50.0130.0209.97
5.1.40.0130.02010.06
5.1.30.0070.03010.27
5.1.20.0100.03310.41
5.1.10.0100.02710.13
5.1.00.0070.03010.02
5.0.50.0030.0238.52
5.0.40.0070.0178.57
5.0.30.0030.0338.20
5.0.20.0000.0238.14
5.0.10.0030.0238.17
5.0.00.0100.0278.16
4.4.90.0030.0175.91
4.4.80.0100.0136.01
4.4.70.0000.0205.87
4.4.60.0070.0136.01
4.4.50.0100.0136.02
4.4.40.0030.0276.03
4.4.30.0030.0175.92
4.4.20.0070.0175.96
4.4.10.0000.0205.90
4.4.00.0070.0235.89
4.3.110.0030.0205.79
4.3.100.0030.0175.89
4.3.90.0030.0175.76
4.3.80.0030.0305.77
4.3.70.0000.0205.74
4.3.60.0070.0175.84
4.3.50.0100.0135.76
4.3.40.0030.0305.72
4.3.30.0030.0234.54
4.3.20.0030.0174.54
4.3.10.0000.0204.46
4.3.00.0100.0237.29

preferences:
38.83 ms | 400 KiB | 5 Q