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('http://google.de/search?q=1&t=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.0070.01318.43
8.3.50.0150.00921.92
8.3.40.0110.00318.97
8.3.30.0080.00818.96
8.3.20.0080.00018.91
8.3.10.0040.00421.23
8.3.00.0080.00023.46
8.2.180.0140.00718.41
8.2.170.0110.00322.96
8.2.160.0110.00420.35
8.2.150.0000.00924.18
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0040.00419.23
8.2.110.0060.00320.91
8.2.100.0040.00817.91
8.2.90.0080.00019.40
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0050.00318.04
8.2.50.0070.00318.07
8.2.40.0030.00718.28
8.2.30.0000.00819.84
8.2.20.0000.00717.84
8.2.10.0000.00817.80
8.2.00.0040.00417.82
8.1.280.0110.00425.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00619.55
8.1.230.0040.00817.77
8.1.220.0000.00818.77
8.1.210.0000.00818.97
8.1.200.0080.00017.36
8.1.190.0070.00017.41
8.1.180.0000.00818.10
8.1.170.0080.00018.50
8.1.160.0070.00018.89
8.1.150.0060.00318.61
8.1.140.0000.00717.37
8.1.130.0030.00317.75
8.1.120.0000.00717.46
8.1.110.0090.00017.46
8.1.100.0040.00417.44
8.1.90.0000.00717.46
8.1.80.0000.00717.37
8.1.70.0000.00717.40
8.1.60.0000.00917.51
8.1.50.0040.00417.43
8.1.40.0040.00417.37
8.1.30.0080.00017.66
8.1.20.0050.00317.70
8.1.10.0080.00017.45
8.1.00.0040.00417.37
8.0.300.0000.00719.89
8.0.290.0080.00018.61
8.0.280.0030.00318.45
8.0.270.0030.00317.17
8.0.260.0000.00616.82
8.0.250.0050.00217.04
8.0.240.0050.00417.08
8.0.230.0030.00317.01
8.0.220.0070.00016.90
8.0.210.0040.00416.83
8.0.200.0000.00717.04
8.0.190.0040.00417.00
8.0.180.0000.00716.97
8.0.170.0030.00616.92
8.0.160.0030.00316.97
8.0.150.0030.00616.99
8.0.140.0090.00016.95
8.0.130.0030.00313.35
8.0.120.0000.00816.92
8.0.110.0000.00716.86
8.0.100.0040.00416.85
8.0.90.0000.00816.92
8.0.80.0110.00416.91
8.0.70.0020.00517.01
8.0.60.0040.00417.03
8.0.50.0040.00416.73
8.0.30.0120.00717.11
8.0.20.0090.00917.40
8.0.10.0050.00216.93
8.0.00.0130.00716.72
7.4.330.0050.00014.70
7.4.320.0040.00416.60
7.4.300.0000.00816.52
7.4.290.0030.00316.65
7.4.280.0070.00316.61
7.4.270.0000.00716.66
7.4.260.0000.00513.39
7.4.250.0050.00316.49
7.4.240.0000.00716.59
7.4.230.0030.00316.43
7.4.220.0100.00716.45
7.4.210.0090.00916.48
7.4.200.0030.00316.72
7.4.190.0050.00216.78
7.4.160.0060.01616.47
7.4.150.0100.01017.40
7.4.140.0100.01017.86
7.4.130.0110.00816.56
7.4.120.0110.00516.48
7.4.110.0070.01116.59
7.4.100.0100.01016.55
7.4.90.0030.01716.63
7.4.80.0120.00319.37
7.4.70.0070.01016.47
7.4.60.0140.00316.55
7.4.50.0000.00816.58
7.4.40.0100.00422.27
7.4.30.0070.01316.29
7.4.00.0040.01414.83
7.3.330.0020.00213.36
7.3.320.0050.00013.36
7.3.310.0030.00316.53
7.3.300.0070.00016.41
7.3.290.0090.00716.43
7.3.280.0100.00716.39
7.3.270.0110.01117.40
7.3.260.0160.00518.24
7.3.250.0070.01716.43
7.3.240.0100.01016.64
7.3.230.0110.00616.44
7.3.210.0090.00916.46
7.3.200.0080.01619.39
7.3.190.0030.01416.39
7.3.180.0080.00816.41
7.3.170.0090.00616.47
7.3.160.0120.00416.39
7.3.120.0030.01014.63
7.3.10.0140.00316.49
7.3.00.0050.01616.35
7.2.330.0090.00916.82
7.2.320.0060.00916.59
7.2.310.0060.01216.81
7.2.300.0060.01116.83
7.2.290.0060.00916.82
7.2.130.0120.00616.27
7.2.120.0150.00316.34
7.2.110.0100.00916.74
7.2.100.0160.00416.67
7.2.90.0120.00617.09
7.2.80.0170.00017.14
7.2.70.0070.01016.86
7.2.60.0080.00516.66
7.2.50.0120.00616.68
7.2.40.0150.00417.16
7.2.30.0100.00717.22
7.2.20.0070.00716.96
7.2.10.0120.00316.80
7.2.00.0070.01017.91
7.1.250.0200.00315.25
7.1.200.0130.00515.64
7.1.100.0040.00418.14
7.1.70.0100.00317.21
7.1.60.0070.01719.40
7.1.50.0000.01217.07
7.1.00.0030.06722.57
7.0.200.0000.01416.87
7.0.140.0000.07021.91
7.0.110.0230.04019.95
7.0.100.0330.08319.96
7.0.90.0430.06019.95
7.0.80.0430.05720.00
7.0.70.0170.04019.94
7.0.60.0030.05319.96
7.0.50.0500.04319.91
7.0.40.0000.07719.78
7.0.30.0030.05319.69
7.0.20.0100.08319.75
7.0.10.0030.06319.78
7.0.00.0070.06019.77
5.6.260.0030.06320.50
5.6.250.0030.07020.63
5.6.240.0000.08020.66
5.6.230.0070.04320.54
5.6.220.0100.06020.59
5.6.210.0070.06720.56
5.6.200.0130.03320.63
5.6.190.0100.08020.61
5.6.180.0030.05020.84
5.6.170.0170.07720.70
5.6.160.0070.06320.56
5.6.150.0070.09320.82
5.6.140.0030.08320.64
5.6.130.0070.04320.61
5.6.120.0100.07020.55
5.6.110.0070.04020.60
5.6.100.0130.07720.56
5.6.90.0070.07320.61
5.6.80.0170.05719.95
5.6.70.0030.07020.01
5.6.60.0070.04719.98
5.6.50.0070.06020.02
5.6.40.0000.04320.06
5.6.30.0000.04719.97
5.6.20.0070.08720.21
5.6.10.0070.07320.20
5.6.00.0100.07319.95
5.5.380.0130.06017.59
5.5.370.0030.04717.58
5.5.360.0070.07317.67
5.5.350.0070.05717.50
5.5.340.0030.07317.82
5.5.330.0000.04318.10
5.5.320.0030.04718.23
5.5.310.0100.06318.10
5.5.300.0030.08717.83
5.5.290.0100.03717.91
5.5.280.0070.06318.10
5.5.270.0030.06017.84
5.5.260.0030.07018.07
5.5.250.0100.04717.90
5.5.240.0000.04717.62
5.5.230.0100.06317.48
5.5.220.0100.04017.63
5.5.210.0070.05717.46
5.5.200.0000.05017.46
5.5.190.0070.07717.40
5.5.180.0070.04717.48
5.5.160.0170.06017.26
5.5.150.0100.04017.28
5.5.140.0070.05017.48
5.5.130.0000.05717.31
5.5.120.0030.03717.18
5.5.110.0000.05017.28
5.5.100.0070.03317.18
5.5.90.0030.03717.50
5.5.80.0030.03717.38
5.5.70.0070.03717.15
5.5.60.0070.05317.29
5.5.50.0200.02017.29
5.5.40.0000.04017.29
5.5.30.0070.03717.33
5.5.20.0100.02317.37
5.5.10.0030.04017.33
5.5.00.0000.03717.32
5.4.450.0130.07019.51
5.4.440.0100.05019.49
5.4.430.0030.04319.35
5.4.420.0130.03319.34
5.4.410.0030.06019.19
5.4.400.0000.04719.09
5.4.390.0030.06319.32
5.4.380.0030.04019.23
5.4.370.0100.03719.34
5.4.360.0100.07018.95
5.4.350.0030.04019.14
5.4.340.0100.05019.03
5.4.320.0000.05019.01
5.4.310.0030.05019.24
5.4.300.0070.03719.16
5.4.290.0030.04319.14
5.4.280.0070.07019.14
5.4.270.0070.03718.99
5.4.260.0030.03719.01
5.4.250.0030.05019.08
5.4.240.0000.04018.98
5.4.230.0030.04018.99
5.4.220.0070.03719.00
5.4.210.0030.03719.22
5.4.200.0070.03019.15
5.4.190.0000.03719.08
5.4.180.0170.02719.33
5.4.170.0030.03718.94
5.4.160.0070.03319.07
5.4.150.0000.03319.22
5.4.140.0000.03716.61
5.4.130.0070.02716.32
5.4.120.0000.03316.38
5.4.110.0000.03316.65
5.4.100.0030.03016.59
5.4.90.0070.03316.55
5.4.80.0000.03316.55
5.4.70.0070.03016.48
5.4.60.0000.03316.52
5.4.50.0030.03016.29
5.4.40.0070.02716.44
5.4.30.0000.03316.44
5.4.20.0030.03016.56
5.4.10.0000.03316.37
5.4.00.0070.02715.93
5.3.290.0070.07714.70
5.3.280.0000.04014.61
5.3.270.0070.03714.62
5.3.260.0070.03014.69
5.3.250.0000.03314.70
5.3.240.0070.03014.60
5.3.230.0000.03314.55
5.3.220.0030.03714.59
5.3.210.0030.03714.61
5.3.200.0000.03314.59
5.3.190.0030.03014.70
5.3.180.0100.03314.54
5.3.170.0030.03314.52
5.3.160.0030.03014.65
5.3.150.0070.03314.65
5.3.140.0000.03314.57
5.3.130.0030.03014.68
5.3.120.0100.02714.63
5.3.110.0000.03714.41
5.3.100.0100.02714.02
5.3.90.0030.03014.10
5.3.80.0000.03313.99
5.3.70.0030.03013.98
5.3.60.0000.03314.14
5.3.50.0030.03014.01
5.3.40.0070.03013.96
5.3.30.0000.03313.86
5.3.20.0130.02313.67
5.3.10.0070.02313.63
5.3.00.0000.03013.75
5.2.170.0030.03011.91
5.2.160.0000.02711.91
5.2.150.0100.02011.91
5.2.140.0030.02311.91
5.2.130.0100.03011.91
5.2.120.0070.02011.91
5.2.110.0030.02311.91
5.2.100.0030.02311.91
5.2.90.0030.02311.91
5.2.80.0030.02311.91
5.2.70.0000.02711.91
5.2.60.0030.02711.91
5.2.50.0030.02311.91
5.2.40.0070.02311.91
5.2.30.0000.02711.91
5.2.20.0000.02311.91
5.2.10.0000.03311.91
5.2.00.0000.02711.91
5.1.60.0030.02311.91
5.1.50.0000.02711.91
5.1.40.0000.02011.91
5.1.30.0000.02311.91
5.1.20.0030.02311.91
5.1.10.0100.01711.91
5.1.00.0000.02311.91
5.0.50.0070.01011.91
5.0.40.0000.02011.91
5.0.30.0000.02711.91
5.0.20.0000.03011.91
5.0.10.0000.02011.91
5.0.00.0030.05311.91
4.4.90.0070.01011.91
4.4.80.0030.01011.91
4.4.70.0000.01711.91
4.4.60.0030.01311.91
4.4.50.0000.01711.91
4.4.40.0030.03011.91
4.4.30.0000.01311.91
4.4.20.0000.01311.91
4.4.10.0030.01011.91
4.4.00.0000.03311.91
4.3.110.0030.01311.91
4.3.100.0000.01711.91
4.3.90.0000.02311.91
4.3.80.0030.02011.91
4.3.70.0070.01011.91
4.3.60.0000.01711.91
4.3.50.0000.02311.91
4.3.40.0000.02011.91
4.3.30.0000.01711.91
4.3.20.0070.03011.91
4.3.10.0030.03711.91
4.3.00.0000.02711.91

preferences:
51.13 ms | 401 KiB | 5 Q