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.3.10.0030.00916.29
7.3.00.0090.00216.56
7.2.130.0070.00716.66
7.2.120.0100.00016.75
7.2.110.0060.00516.74
7.2.100.0050.01416.55
7.2.90.0030.00616.58
7.2.80.0060.00616.64
7.2.70.0100.00416.83
7.2.60.0070.00616.69
7.2.50.0060.00716.66
7.2.40.0070.01016.81
7.2.30.0100.00816.68
7.2.20.0090.00916.57
7.2.10.0040.01116.77
7.2.00.0070.01116.76
7.1.250.0080.00615.55
7.1.240.0100.00315.57
7.1.230.0070.00315.61
7.1.220.0060.00315.77
7.1.210.0000.01415.58
7.1.200.0090.00315.52
7.1.190.0040.00415.86
7.1.180.0000.00915.80
7.1.170.0030.00715.36
7.1.160.0060.00615.63
7.1.150.0070.00315.76
7.1.140.0060.00615.82
7.1.130.0040.00415.56
7.1.120.0120.00915.73
7.1.110.0120.00015.82
7.1.100.0030.01015.65
7.1.90.0000.01115.37
7.1.80.0030.00715.75
7.1.70.0080.00216.17
7.1.60.0060.01017.61
7.1.50.0050.01216.32
7.1.40.0000.01315.53
7.1.30.0030.00915.89
7.1.20.0000.01015.72
7.1.10.0060.00615.46
7.1.00.0050.04019.08
7.0.330.0060.00615.27
7.0.320.0030.00515.27
7.0.310.0030.00715.10
7.0.300.0000.01015.46
7.0.290.0030.00915.38
7.0.280.0030.00915.47
7.0.270.0040.00715.33
7.0.260.0090.00615.05
7.0.250.0120.00315.08
7.0.240.0060.00915.37
7.0.230.0070.00315.52
7.0.220.0090.00315.44
7.0.210.0030.00715.43
7.0.200.0080.00316.01
7.0.190.0060.00915.27
7.0.180.0080.00015.20
7.0.170.0000.00715.24
7.0.160.0000.01215.48
7.0.150.0070.00415.23
7.0.140.0010.04118.62
7.0.130.0140.00315.30
7.0.120.0100.00315.28
7.0.110.0000.01315.25
7.0.100.0000.01315.09
7.0.90.0090.00415.21
7.0.80.0000.01515.37
7.0.70.0040.00415.39
7.0.60.0140.04217.57
7.0.50.0010.04416.50
7.0.40.0030.03916.84
7.0.30.0150.02816.67
7.0.20.0130.02416.79
7.0.10.0070.02016.79
7.0.00.0020.04116.58
5.6.380.0070.00714.29
5.6.370.0060.00614.01
5.6.360.0040.01113.98
5.6.350.0110.00414.01
5.6.340.0000.01614.40
5.6.330.0000.01213.84
5.6.320.0030.00914.10
5.6.310.0070.00414.15
5.6.300.0080.00414.06
5.6.290.0040.00814.10
5.6.280.0020.04317.89
5.6.270.0030.00514.14
5.6.260.0030.01014.46
5.6.250.0050.00514.15
5.6.240.0040.01114.38
5.6.230.0040.00914.56
5.6.220.0000.01514.14
5.6.210.0070.03717.55
5.6.200.0030.03316.08
5.6.190.0040.03217.29
5.6.180.0090.02517.38
5.6.170.0180.02817.36
5.6.160.0160.03517.46
5.6.150.0080.04316.19
5.6.140.0030.02216.13
5.6.130.0040.02716.17
5.6.120.0060.02317.73
5.6.110.0050.04817.43
5.6.100.0020.04217.67
5.6.90.0070.03717.58
5.6.80.0100.04117.41
5.6.70.0000.01014.38
5.6.60.0030.00613.96
5.6.50.0070.00714.20
5.6.40.0000.01214.29
5.6.30.0030.01014.12
5.6.20.0080.00313.95
5.6.10.0050.00514.21
5.6.00.0000.01114.12
5.5.380.0070.00311.18
5.5.370.0050.00211.18
5.5.360.0040.00411.18
5.5.350.0120.03315.80
5.5.340.0040.02214.58
5.5.330.0090.04115.87
5.5.320.0220.03615.75
5.5.310.0160.03015.76
5.5.300.0030.02914.60
5.5.290.0050.03414.58
5.5.280.0090.02016.00
5.5.270.0110.03815.98
5.5.260.0040.02915.93
5.5.250.0070.03515.94
5.5.240.2120.02815.77
5.5.230.0000.00811.18
5.5.220.0000.01111.18
5.5.210.0040.00411.18
5.5.200.0060.00311.18
5.5.190.0060.00311.18
5.5.180.0000.00811.18
5.5.170.0000.00811.23
5.5.160.0030.00911.18
5.5.150.0030.00311.18
5.5.140.0030.00711.18
5.5.130.0030.00311.18
5.5.120.0060.00311.18
5.5.110.0080.00311.18
5.5.100.0050.00311.18
5.5.90.0040.00411.18
5.5.80.0030.00311.29
5.5.70.0070.00311.18
5.5.60.0000.00911.18
5.5.50.0000.01111.18
5.5.40.0000.01311.18
5.5.30.0000.01011.18
5.5.20.0000.01111.18
5.5.10.0030.00311.18
5.5.00.0120.00011.18
5.4.450.0190.03715.34
5.4.440.0170.03815.32
5.4.430.0180.03115.29
5.4.420.0130.04615.24
5.4.410.0160.03315.22
5.4.400.0130.02515.16
5.4.390.0140.04415.11
5.4.380.0170.03915.21
5.4.370.0150.02715.16
5.4.360.0130.03415.01
5.4.350.0130.03515.20
5.4.340.0200.03515.21
5.4.330.0040.00411.18
5.4.320.0150.03815.08
5.4.310.0130.03615.09
5.4.300.0120.04115.08
5.4.290.0210.03015.15
5.4.280.0230.03015.18
5.4.270.0150.02615.13
5.4.260.0180.02715.12
5.4.250.0220.03315.21
5.4.240.0160.02815.12
5.4.230.0260.03115.18
5.4.220.0170.03815.18
5.4.210.0220.03515.24
5.4.200.0150.02715.06
5.4.190.0130.04315.12
5.4.180.0180.02615.15
5.4.170.0180.02815.02
5.4.160.0110.02315.18
5.4.150.0170.02815.01
5.4.140.0180.02313.95
5.4.130.0150.02913.81
5.4.120.0150.03313.86
5.4.110.0130.02713.79
5.4.100.0200.03013.75
5.4.90.0190.03413.84
5.4.80.0200.03613.74
5.4.70.0130.02813.83
5.4.60.0150.03813.86
5.4.50.0180.03013.74
5.4.40.0220.03213.83
5.4.30.0170.03713.86
5.4.20.0160.02013.80
5.4.10.0130.03713.80
5.4.00.0140.03613.47
5.3.290.0150.03912.89
5.3.280.0130.03812.94
5.3.270.0160.02612.85
5.3.260.0120.02712.85
5.3.250.0130.03012.91
5.3.240.0180.03212.89
5.3.230.0130.03513.00
5.3.220.0170.02312.88
5.3.210.0120.02712.90
5.3.200.0120.03012.89
5.3.190.0180.03512.88
5.3.180.0190.03612.88
5.3.170.0160.03312.92
5.3.160.0200.03812.84
5.3.150.0170.03612.91
5.3.140.0150.03212.86
5.3.130.0180.03112.98
5.3.120.0250.01712.93
5.3.110.0170.03612.89
5.3.100.0190.03912.64
5.3.90.0130.03612.55
5.3.80.0190.01812.56
5.3.70.0140.03712.59
5.3.60.0151.55312.60
5.3.50.0120.04212.58
5.3.40.0210.03212.52
5.3.30.0150.02512.51
5.3.20.0100.02412.41
5.3.10.0150.03712.43
5.3.00.0170.02612.37
5.2.170.0120.02011.72
5.2.160.0120.02411.72
5.2.150.0100.02611.72
5.2.140.0200.02011.72
5.2.130.0100.03311.72
5.2.120.0150.02811.72
5.2.110.0120.03211.72
5.2.100.0100.02111.72
5.2.90.0100.02011.72
5.2.80.0110.01611.72
5.2.70.0100.01711.72
5.2.60.0150.01811.72
5.2.50.0080.02511.72
5.2.40.0130.03111.72
5.2.30.0140.03011.72
5.2.20.0110.02011.72
5.2.10.0130.02511.72
5.2.00.0070.02211.72
5.1.60.0070.02511.72
5.1.50.0150.02311.72
5.1.40.0120.02111.72
5.1.30.0170.02711.72
5.1.20.0140.02511.72
5.1.10.0120.02311.72
5.1.00.0110.02911.72
5.0.50.0130.01311.72
5.0.40.0100.01811.72
5.0.30.0110.03011.72
5.0.20.0050.02111.72
5.0.10.0060.01111.72
5.0.00.0120.02811.72
4.4.90.0090.01711.72
4.4.80.0100.01711.72
4.4.70.0050.02211.72
4.4.60.0050.02011.72
4.4.50.0070.01511.72
4.4.40.0050.02911.72
4.4.30.0070.01711.72
4.4.20.0070.01711.72
4.4.10.0050.02111.72
4.4.00.0070.02811.72
4.3.110.0070.01311.72
4.3.100.0030.01611.72
4.3.90.0080.01011.72
4.3.80.0080.02411.72
4.3.70.0070.01411.72
4.3.60.0070.00711.72
4.3.50.0070.01511.72
4.3.40.0080.02211.72
4.3.30.0050.01811.72
4.3.20.0030.01311.72
4.3.10.0060.01011.72
4.3.00.0020.01511.72

preferences:
35.91 ms | 401 KiB | 5 Q