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&r=sadf+asfd+adsf', '//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) . '\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)
8.3.60.0030.01316.38
8.3.50.0130.00917.12
8.3.40.0090.01218.83
8.3.30.0110.00418.62
8.3.20.0080.00018.65
8.3.10.0030.00620.48
8.3.00.0070.00417.37
8.2.180.0070.01316.75
8.2.170.0040.01122.96
8.2.160.0100.00320.39
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0070.00019.20
8.2.110.0070.00319.04
8.2.100.0090.00317.78
8.2.90.0080.00019.31
8.2.80.0000.00719.39
8.2.70.0000.00917.63
8.2.60.0030.00718.04
8.2.50.0030.00518.07
8.2.40.0040.00418.34
8.2.30.0040.00418.21
8.2.20.0030.00619.39
8.2.10.0000.00717.74
8.2.00.0040.00417.73
8.1.280.0060.00925.92
8.1.270.0050.00324.66
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00722.59
8.1.230.0070.00421.04
8.1.220.0000.00818.77
8.1.210.0040.00418.98
8.1.200.0000.01017.22
8.1.190.0000.00917.66
8.1.180.0080.00018.10
8.1.170.0040.00418.77
8.1.160.0020.00518.84
8.1.150.0080.00018.65
8.1.140.0040.00417.43
8.1.130.0030.00317.83
8.1.120.0000.00717.49
8.1.110.0040.00417.42
8.1.100.0030.00417.47
8.1.90.0070.00017.41
8.1.80.0000.00717.35
8.1.70.0000.00717.42
8.1.60.0030.00617.59
8.1.50.0030.00517.45
8.1.40.0040.00417.48
8.1.30.0030.00617.54
8.1.20.0000.00817.63
8.1.10.0040.00417.62
8.1.00.0040.00417.50
8.0.300.0080.00019.95
8.0.290.0000.00716.75
8.0.280.0040.00418.48
8.0.270.0030.00317.19
8.0.260.0030.00316.69
8.0.250.0040.00416.93
8.0.240.0040.00416.94
8.0.230.0070.00016.95
8.0.220.0000.00716.80
8.0.210.0000.00716.89
8.0.200.0040.00416.91
8.0.190.0040.00416.99
8.0.180.0070.00016.96
8.0.170.0060.00316.91
8.0.160.0030.00316.79
8.0.150.0090.00016.82
8.0.140.0040.00416.79
8.0.130.0050.00013.29
8.0.120.0000.00716.88
8.0.110.0040.00416.93
8.0.100.0080.00016.90
8.0.90.0080.00016.88
8.0.80.0060.00916.87
8.0.70.0040.00416.78
8.0.60.0070.00016.87
8.0.50.0040.00416.78
8.0.30.0060.01217.27
8.0.20.0070.01116.76
8.0.10.0050.00217.03
8.0.00.0080.00916.70
7.4.330.0020.00212.89
7.4.320.0030.00316.55
7.4.300.0030.00316.64
7.4.290.0070.00016.51
7.4.280.0080.00016.61
7.4.270.0030.00316.52
7.4.260.0050.00013.27
7.4.250.0030.00516.63
7.4.240.0030.00316.41
7.4.230.0030.00316.37
7.4.220.0140.00416.38
7.4.210.0090.00716.57
7.4.200.0050.00216.61
7.4.190.0000.00716.73
7.4.160.0060.01516.27
7.4.150.0120.00616.41
7.4.140.0120.00616.47
7.4.130.0100.00916.57
7.4.120.0100.00716.49
7.4.110.0120.00916.60
7.4.100.0100.00716.66
7.4.90.0060.01216.54
7.4.80.0070.01019.39
7.4.70.0130.00716.41
7.4.60.0060.00916.48
7.4.50.0060.00616.56
7.4.40.0130.00316.60
7.4.30.0130.00416.58
7.4.00.0120.00514.93
7.3.330.0000.00613.37
7.3.320.0030.00313.34
7.3.310.0000.00816.39
7.3.300.0040.00416.25
7.3.290.0140.00316.38
7.3.280.0040.01116.30
7.3.270.0140.00316.56
7.3.260.0150.00316.56
7.3.250.0070.01216.34
7.3.240.0080.00816.41
7.3.230.0130.00316.62
7.3.210.0090.00916.55
7.3.200.0060.01116.32
7.3.190.0110.00616.48
7.3.180.0090.00816.21
7.3.170.0110.00616.58
7.3.160.0040.01216.48
7.3.120.0080.00914.70
7.3.110.0030.01414.96
7.3.100.0030.01414.71
7.3.90.0040.01414.86
7.3.80.0000.01115.01
7.3.70.0070.00614.72
7.3.60.0030.01014.92
7.3.50.0060.00614.73
7.3.40.0070.00714.82
7.3.30.0060.00614.86
7.3.20.0080.00316.64
7.3.10.0030.00616.53
7.3.00.0060.00316.86
7.2.330.0100.01016.79
7.2.320.0170.00516.53
7.2.310.0110.00816.80
7.2.300.0150.00916.80
7.2.290.0170.00016.82
7.2.250.0070.01414.96
7.2.240.0100.01015.30
7.2.230.0040.01215.18
7.2.220.0070.00315.09
7.2.210.0030.00915.30
7.2.200.0000.01315.21
7.2.190.0060.00615.12
7.2.180.0060.00615.15
7.2.170.0110.00415.21
7.2.00.0000.01619.52
7.1.330.0030.01015.79
7.1.320.0050.00515.50
7.1.310.0060.00915.85
7.1.300.0040.00715.98
7.1.290.0030.01215.82
7.1.280.0030.01015.87
7.1.270.0040.01215.50
7.1.260.0000.00915.51
7.1.100.0030.01417.80
7.1.70.0070.00317.23
7.1.60.0110.01419.40
7.1.50.0040.01516.86
7.1.00.0030.05722.27
7.0.200.0000.00716.48
7.0.140.0070.07322.01
7.0.120.0030.06022.09
7.0.60.0030.04019.95
7.0.50.0100.05317.98
7.0.40.0070.05320.39
7.0.30.0170.04020.26
7.0.20.0270.06320.15
7.0.10.0130.07020.08
7.0.00.0070.05720.33
5.6.280.0070.07020.77
5.6.210.0130.06720.73
5.6.200.0130.08018.27
5.6.190.0100.05320.48
5.6.180.0170.08020.48
5.6.170.0130.04320.62
5.6.160.0070.08720.71
5.6.150.0000.04318.25
5.6.140.0030.07018.19
5.6.130.0130.07318.27
5.6.120.0070.08720.99
5.6.110.0070.08321.02
5.6.100.0000.09320.98
5.6.90.0030.05721.13
5.6.80.0070.07720.39
5.5.350.0030.08720.34
5.5.340.0070.07718.09
5.5.330.0100.06020.42
5.5.320.0200.04320.27
5.5.310.0330.06720.34
5.5.300.0070.08017.95
5.5.290.0030.08318.03
5.5.280.0100.06720.75
5.5.270.0100.08020.98
5.5.260.0130.06320.67
5.5.250.0100.05720.80
5.5.240.0230.05720.36
5.4.450.0100.08319.33
5.4.440.0170.07319.41
5.4.430.0030.08019.19
5.4.420.0070.05719.48
5.4.410.0130.03019.20
5.4.400.0070.06319.16
5.4.390.0030.08318.85
5.4.380.0030.07319.15
5.4.370.0070.07718.93
5.4.360.0070.05318.85
5.4.350.0130.04719.15
5.4.340.0030.07719.12
5.4.320.0130.07019.00
5.4.310.0100.03319.15
5.4.300.0070.07019.23
5.4.290.0100.07319.14
5.4.280.0130.04719.20
5.4.270.0070.03718.92
5.4.260.0130.03719.14
5.4.250.0100.08018.86
5.4.240.0070.05019.23
5.4.230.0100.05719.23
5.4.220.0030.04019.13
5.4.210.0030.08319.23
5.4.200.0070.07719.14
5.4.190.0100.05318.91
5.4.180.0100.07719.23
5.4.170.0030.06718.93
5.4.160.0030.08319.23
5.4.150.0100.06019.22
5.4.140.0100.06716.36
5.4.130.0130.05316.38
5.4.120.0000.04316.42
5.4.110.0130.05316.43
5.4.100.0100.04716.41
5.4.90.0030.06016.41
5.4.80.0000.07716.32
5.4.70.0070.03716.33
5.4.60.0200.04716.44
5.4.50.0000.06316.36
5.4.40.0070.04716.39
5.4.30.0000.04316.39
5.4.20.0070.04716.27
5.4.10.0070.06716.44
5.4.00.0100.07015.87
5.3.290.0100.06714.71
5.3.280.0170.04014.61
5.3.270.0030.08714.61
5.3.260.0000.05314.64
5.3.250.0000.06314.64
5.3.240.0030.07714.50
5.3.230.0030.07314.67
5.3.220.0100.07014.56
5.3.210.0070.05314.62
5.3.200.0130.07014.60
5.3.190.0130.06314.45
5.3.180.0100.07714.61
5.3.170.0070.05014.56
5.3.160.0070.05014.57
5.3.150.0030.04714.59
5.3.140.0070.07314.70
5.3.130.0070.08014.60
5.3.120.0070.06314.58
5.3.110.0170.06314.56
5.3.100.0100.07014.20
5.3.90.0130.07014.09
5.3.80.0130.03713.97
5.3.70.0070.06713.98
5.3.60.0030.08014.00
5.3.50.0070.04313.91
5.3.40.0130.06714.00
5.3.30.0000.04713.90
5.3.20.0170.05313.71
5.3.10.0100.03713.67
5.3.00.0070.07313.70
5.2.170.0070.05711.20
5.2.160.0100.06011.10
5.2.150.0070.05711.18
5.2.140.0030.04011.20
5.2.130.0030.03311.07
5.2.120.0030.04011.17
5.2.110.0000.04711.07
5.2.100.0070.06011.18
5.2.90.0100.05711.07
5.2.80.0000.05311.05
5.2.70.0000.04311.14
5.2.60.0130.04711.00
5.2.50.0070.05010.98
5.2.40.0030.05010.94
5.2.30.0030.06710.86
5.2.20.0070.03010.86
5.2.10.0030.05710.78
5.2.00.0100.05310.71
5.1.60.0100.05010.04
5.1.50.0100.03010.04
5.1.40.0030.0539.98
5.1.30.0030.02710.38
5.1.20.0070.05710.36
5.1.10.0030.05710.09
5.1.00.0000.04710.00
5.0.50.0100.0378.47
5.0.40.0030.0238.47
5.0.30.0030.0608.36
5.0.20.0000.0438.36
5.0.10.0030.0478.36
5.0.00.0030.0708.36
4.4.90.0030.0208.36
4.4.80.0030.0338.36
4.4.70.0000.0408.36
4.4.60.0000.0378.36
4.4.50.0070.0208.36
4.4.40.0030.0538.36
4.4.30.0100.0138.36
4.4.20.0030.0238.36
4.4.10.0030.0178.36
4.4.00.0030.0338.36
4.3.110.0030.0178.36
4.3.100.0030.0278.36
4.3.90.0000.0338.36
4.3.80.0000.0278.36
4.3.70.0000.0378.36
4.3.60.0000.0208.36
4.3.50.0100.0308.36
4.3.40.0000.0308.36
4.3.30.0070.0238.36
4.3.20.0030.0178.36
4.3.10.0030.0278.36
4.3.00.0000.0278.36

preferences:
65.26 ms | 401 KiB | 5 Q