3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! function smartUrlEncode($url) { if (strpos($url, '=') === false) { return $url; } else { $startpos = strpos($url, "?"); $tmpurl = substr($url, 0, $startpos + 1); $qryStr = substr($url, $startpos + 1); $qryvalues = explode("&", $qryStr); foreach ($qryvalues as $value) { $buffer = explode("=", $value); $buffer[1] = urlencode($buffer[1]); } $finalqrystr = implode("&amp;", $qryvalues); $finalURL = $tmpurl . $finalqrystr; return $finalURL; } } $urls_to_test = array( 'https://www.google.de/search?q=php+implode&x=2', 'https://www.google.de/search?q=php+implode&t=453', 'http://google.de/search?q=1&t=2&', '//google.de/search?q=1&t=2+asdf&r=qwertz+asdf', 'index.php?r=1&t=4&e=1' ); foreach($urls_to_test as $url) { //echo smartUrlEncode($url); } echo smartUrlEncode('https://www.google.de/search?q=php+implode&x=2');

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.0120.00618.18
8.3.50.0100.00721.85
8.3.40.0070.00719.00
8.3.30.0090.00618.66
8.3.20.0040.00418.95
8.3.10.0040.00421.22
8.3.00.0040.00423.66
8.2.180.0150.00316.49
8.2.170.0070.00722.96
8.2.160.0070.00720.52
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0030.00519.48
8.2.110.0070.00319.23
8.2.100.0060.00617.78
8.2.90.0040.00417.97
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0080.00017.93
8.2.50.0080.00018.07
8.2.40.0020.00518.22
8.2.30.0030.00519.78
8.2.20.0040.00417.77
8.2.10.0030.00517.75
8.2.00.0000.00717.76
8.1.280.0040.01125.92
8.1.270.0040.00423.99
8.1.260.0060.00826.35
8.1.250.0070.00028.09
8.1.240.0100.00021.85
8.1.230.0100.00020.98
8.1.220.0040.00417.79
8.1.210.0000.00818.85
8.1.200.0030.00617.35
8.1.190.0080.00816.88
8.1.180.0040.00418.10
8.1.170.0050.00318.40
8.1.160.0070.00018.93
8.1.150.0060.00318.71
8.1.140.0050.00217.41
8.1.130.0000.00717.83
8.1.120.0000.00717.38
8.1.110.0000.00817.51
8.1.100.0070.00017.34
8.1.90.0040.00417.44
8.1.80.0040.00417.41
8.1.70.0070.00017.43
8.1.60.0000.00817.50
8.1.50.0040.00417.50
8.1.40.0050.00317.54
8.1.30.0000.00717.66
8.1.20.0000.00917.55
8.1.10.0040.00417.58
8.1.00.0070.00017.50
8.0.300.0000.00720.09
8.0.290.0000.00716.88
8.0.280.0000.00718.51
8.0.270.0000.00717.32
8.0.260.0000.00816.82
8.0.250.0040.00416.97
8.0.240.0040.00416.97
8.0.230.0070.00016.91
8.0.220.0030.00316.89
8.0.210.0070.00016.94
8.0.200.0030.00317.00
8.0.190.0080.00016.91
8.0.180.0040.00416.88
8.0.170.0050.00216.89
8.0.160.0000.00816.86
8.0.150.0030.00516.80
8.0.140.0030.00616.88
8.0.130.0050.00013.38
8.0.120.0050.00216.81
8.0.110.0040.00416.72
8.0.100.0000.00816.72
8.0.90.0070.00016.78
8.0.80.0040.01816.91
8.0.70.0020.00516.88
8.0.60.0070.00016.79
8.0.50.0040.00416.77
8.0.30.0150.00516.96
8.0.20.0100.00817.40
8.0.10.0030.00417.08
8.0.00.0130.00616.61
7.4.330.0050.00014.82
7.4.320.0030.00316.41
7.4.300.0030.00316.62
7.4.290.0000.00816.61
7.4.280.0020.00816.55
7.4.270.0000.00716.59
7.4.260.0050.00013.23
7.4.250.0020.00516.38
7.4.240.0080.00016.48
7.4.230.0000.00716.63
7.4.220.0100.01316.45
7.4.210.0070.00916.52
7.4.200.0050.00216.61
7.4.190.0030.00316.50
7.4.160.0090.01216.66
7.4.150.0140.00317.40
7.4.140.0090.00917.86
7.4.130.0060.01516.64
7.4.120.0050.01216.42
7.4.110.0070.01416.52
7.4.100.0080.00816.41
7.4.90.0140.00516.55
7.4.80.0110.00519.37
7.4.70.0100.00616.44
7.4.60.0080.00816.40
7.4.50.0040.00416.34
7.4.40.0090.00622.27
7.4.30.0120.00616.46
7.4.00.0110.00715.09
7.3.330.0000.00513.32
7.3.320.0040.00413.47
7.3.310.0060.00316.42
7.3.300.0000.00716.23
7.3.290.0090.00616.39
7.3.280.0120.00416.35
7.3.270.0040.01417.40
7.3.260.0110.01218.24
7.3.250.0110.00716.47
7.3.240.0100.00616.36
7.3.230.0100.00716.55
7.3.210.0090.00916.38
7.3.200.0090.00619.39
7.3.190.0120.00316.41
7.3.180.0050.01116.64
7.3.170.0040.01416.31
7.3.160.0120.00416.23
7.3.120.0070.01014.82
7.2.330.0050.01116.72
7.2.320.0090.00916.88
7.2.310.0090.00916.76
7.2.300.0150.00516.72
7.2.290.0060.01216.80
7.2.60.0040.00717.11
7.2.00.0040.01119.30
7.1.200.0000.01115.64
7.1.100.0020.00518.41
7.1.70.0000.00816.88
7.1.60.0100.01319.40
7.1.50.0040.01917.06
7.1.00.0070.07322.57
7.0.200.0030.00616.75
7.0.140.0030.07322.09
7.0.60.0070.06719.95
7.0.50.0070.08017.90
7.0.40.0070.05017.86
7.0.30.0070.06317.72
7.0.20.0130.07317.74
7.0.10.0000.08317.82
7.0.00.0070.07717.80
5.6.210.0070.08720.53
5.6.200.0070.05318.29
5.6.190.0100.06718.22
5.6.180.0030.08318.28
5.6.170.0030.04318.15
5.6.160.0030.07718.14
5.6.150.0130.06318.15
5.6.140.0000.05718.11
5.6.130.0100.06318.22
5.6.120.0030.05018.28
5.6.110.0130.08018.18
5.6.100.0070.08718.14
5.6.90.0100.07318.21
5.6.80.0100.07017.61
5.6.70.0030.04717.60
5.6.60.0100.06017.64
5.6.50.0100.07717.54
5.6.40.0070.07017.53
5.6.30.0070.07717.63
5.6.20.0130.06317.62
5.6.10.0100.07017.47
5.6.00.0000.05317.55
5.5.350.0070.09020.30
5.5.340.0070.08318.09
5.5.330.0130.07017.95
5.5.320.0030.06717.98
5.5.310.0070.06018.08
5.5.300.0070.08318.07
5.5.290.0070.08317.95
5.5.280.0070.06317.98
5.5.270.0100.07717.91
5.5.260.0100.08018.03
5.5.250.0100.05717.85
5.5.240.0100.05717.42
5.5.230.0030.05717.39
5.5.220.0100.04317.39
5.5.210.0030.08317.30
5.5.200.0070.06717.38
5.5.190.0030.05717.29
5.5.180.0100.07317.29
5.5.160.0070.07717.34
5.5.150.0030.05017.26
5.5.140.0030.05717.32
5.5.130.0030.05317.38
5.5.120.0100.07717.39
5.5.110.0000.08317.43
5.5.100.0070.05317.25
5.5.90.0070.08017.33
5.5.80.0100.07717.20
5.5.70.0200.03717.22
5.5.60.0130.06017.21
5.5.50.0100.04317.23
5.5.40.0030.04317.23
5.5.30.0130.06717.19
5.5.20.0000.05717.22
5.5.10.0000.05017.22
5.5.00.0070.07317.25
5.4.450.0030.04719.43
5.4.440.0130.04719.38
5.4.430.0070.08019.45
5.4.420.0100.06019.42
5.4.410.0170.07019.23
5.4.400.0170.07019.06
5.4.390.0030.07319.14
5.4.380.0000.08019.28
5.4.370.0100.06019.31
5.4.360.0070.07719.10
5.4.350.0100.04019.05
5.4.340.0070.07719.01
5.4.320.0030.06019.03
5.4.310.0100.06019.13
5.4.300.0070.08019.13
5.4.290.0100.07319.13
5.4.280.0070.07319.04
5.4.270.0200.04719.11
5.4.260.0070.05019.01
5.4.250.0070.04319.04
5.4.240.0100.04719.12
5.4.230.0030.08319.10
5.4.220.0170.06719.04
5.4.210.0030.08319.02
5.4.200.0100.04319.09
5.4.190.0030.06319.02
5.4.180.0100.08319.12
5.4.170.0100.07718.88
5.4.160.0030.05019.25
5.4.150.0100.07019.25
5.4.140.0130.06716.36
5.4.130.0000.06016.58
5.4.120.0100.04316.36
5.4.110.0030.08316.24
5.4.100.0130.06016.38
5.4.90.0070.07016.41
5.4.80.0070.03316.37
5.4.70.0130.05716.41
5.4.60.0000.05716.56
5.4.50.0070.05316.43
5.4.40.0070.06016.46
5.4.30.0170.03316.37
5.4.20.0070.07016.53
5.4.10.0070.04716.55
5.4.00.0070.04715.74
5.3.290.0130.07314.71
5.3.280.0070.06014.57
5.3.270.0070.07014.56
5.3.260.0130.07314.66
5.3.250.0030.05014.64
5.3.240.0030.07714.67
5.3.230.0030.07714.67
5.3.220.0030.08014.64
5.3.210.0100.03314.53
5.3.200.0030.06714.64
5.3.190.0000.04714.78
5.3.180.0030.08014.63
5.3.170.0070.08014.60
5.3.160.0030.06014.61
5.3.150.0070.06014.57
5.3.140.0030.06314.61
5.3.130.0030.06314.61
5.3.120.0100.05314.58
5.3.110.0070.07314.40
5.3.100.0100.06014.08
5.3.90.0100.06714.09
5.3.80.0000.05714.04
5.3.70.0130.06713.82
5.3.60.0130.06014.03
5.3.50.0130.06713.99
5.3.40.0030.04013.84
5.3.30.0030.06013.98
5.3.20.0100.06713.74
5.3.10.0030.04313.68
5.3.00.0030.07013.53
5.2.170.0030.06711.18
5.2.160.0100.05011.20
5.2.150.0070.06011.04
5.2.140.0100.06011.16
5.2.130.0130.05311.31
5.2.120.0030.04711.14
5.2.110.0130.04311.16
5.2.100.0030.06311.20
5.2.90.0200.04711.10
5.2.80.0070.04011.12
5.2.70.0070.06011.14
5.2.60.0100.05711.11
5.2.50.0030.05710.87
5.2.40.0000.05311.04
5.2.30.0100.05710.98
5.2.20.0030.06011.17
5.2.10.0070.04710.91
5.2.00.0000.06010.77
5.1.60.0030.05010.00
5.1.50.0070.0279.99
5.1.40.0130.02310.01
5.1.30.0000.04710.29
5.1.20.0070.05310.39
5.1.10.0030.02710.08
5.1.00.0130.05010.05
5.0.50.0030.0378.52
5.0.40.0030.0278.37
5.0.30.0130.0378.15
5.0.20.0000.0438.19
5.0.10.0000.0438.15
5.0.00.0030.0608.22
4.4.90.0000.0407.71
4.4.80.0000.0407.71
4.4.70.0030.0337.71
4.4.60.0030.0237.71
4.4.50.0000.0407.71
4.4.40.0000.0377.71
4.4.30.0030.0237.71
4.4.20.0070.0137.71
4.4.10.0000.0307.71
4.4.00.0030.0337.71
4.3.110.0000.0407.71
4.3.100.0000.0237.71
4.3.90.0030.0377.71
4.3.80.0030.0407.71
4.3.70.0000.0377.71
4.3.60.0100.0177.71
4.3.50.0000.0407.71
4.3.40.0070.0477.71
4.3.30.0000.0307.71
4.3.20.0000.0337.71
4.3.10.0000.0407.71
4.3.00.0000.0207.71

preferences:
43.77 ms | 401 KiB | 5 Q