3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a($strUrl) { $strUrl = explode('/', $strUrl, 4); $strUrl[3] = rawurlencode($strUrl[3]); $strUrl[3] = str_replace(array('%2F', '%3F', '%3D', '%26', '%25'), array('/', '?', '=', '&', '%'), $strUrl[3]); $strUrl = implode('/', $strUrl); $strUrl = str_replace('&', '&amp;', $strUrl); return $strUrl; } function b($strUrl) { return htmlspecialchars($strUrl, ENT_XML1, 'UTF-8'); } $urls = array( 'http://www.example.com/', 'http://www.example.com/alias', 'http://www.example.com/alias.html', 'http://www.example.com/alias/page?foo=bar', 'http://www.example.com/alias?foo=bar&bar=foo', 'http://www.example.com:8080/alias', 'http://www.example.com:8080/alias?foo=bar&bar[bar]=foo', 'http://www.example.com/älias', ); foreach ($urls as $url) { if (a($url) === b($url)) { echo "✓\n"; echo $url."\n"; } else { echo "✘\n"; echo $url."\n"; echo a($url)."\n"; echo b($url)."\n"; } echo "\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.0090.00618.30
8.3.50.0040.01118.17
8.3.40.0150.00018.84
8.3.30.0120.00418.70
8.3.20.0060.00320.18
8.3.10.0050.00323.61
8.3.00.0000.00819.68
8.2.180.0070.01118.14
8.2.170.0100.00722.96
8.2.160.0120.00620.39
8.2.150.0080.00025.66
8.2.140.0080.00024.66
8.2.130.0020.00526.16
8.2.120.0080.00020.88
8.2.110.0040.00720.57
8.2.100.0070.00717.72
8.2.90.0080.00017.91
8.2.80.0000.00820.48
8.2.70.0050.00317.93
8.2.60.0050.00317.93
8.2.50.0000.00818.34
8.2.40.0050.00320.28
8.2.30.0030.00619.20
8.2.20.0040.00418.07
8.2.10.0040.00418.02
8.2.00.0040.00418.19
8.1.280.0120.00625.92
8.1.270.0040.00420.36
8.1.260.0030.00626.35
8.1.250.0080.00028.09
8.1.240.0060.00323.83
8.1.230.0030.00920.75
8.1.220.0040.00417.74
8.1.210.0000.00918.79
8.1.200.0060.00317.35
8.1.190.0090.00017.13
8.1.180.0080.00018.10
8.1.170.0040.00418.54
8.1.160.0000.00718.90
8.1.150.0040.00420.28
8.1.140.0080.00017.71
8.1.130.0060.00318.91
8.1.120.0070.00017.31
8.1.110.0040.00417.36
8.1.100.0050.00217.37
8.1.90.0040.00417.44
8.1.80.0000.00817.44
8.1.70.0000.01017.46
8.1.60.0000.01017.44
8.1.50.0000.00817.56
8.1.40.0040.00417.52
8.1.30.0000.00917.50
8.1.20.0040.00417.66
8.1.10.0040.00417.59
8.1.00.0050.00517.48
8.0.300.0040.00420.16
8.0.290.0040.00416.58
8.0.280.0030.00318.39
8.0.270.0070.00017.19
8.0.260.0000.00716.94
8.0.250.0070.00017.01
8.0.240.0070.00016.88
8.0.230.0070.00016.97
8.0.220.0050.00316.88
8.0.210.0050.00316.83
8.0.200.0070.00016.97
8.0.190.0060.00316.86
8.0.180.0000.00716.93
8.0.170.0080.00316.98
8.0.160.0050.00316.89
8.0.150.0000.00716.83
8.0.140.0070.00016.80
8.0.130.0000.00513.35
8.0.120.0040.00416.80
8.0.110.0000.00816.93
8.0.100.0000.00716.85
8.0.90.0050.00316.93
8.0.80.0110.00316.87
8.0.70.0080.00016.89
8.0.60.0040.00416.84
8.0.50.0000.00816.89
8.0.30.0090.01017.13
8.0.20.0160.00617.40
8.0.10.0040.00416.96
8.0.00.0030.01416.79
7.4.330.0000.00515.55
7.4.320.0030.00316.50
7.4.300.0060.00016.41
7.4.290.0050.00216.60
7.4.280.0040.00416.55
7.4.270.0030.00316.44
7.4.260.0030.00316.57
7.4.250.0000.00816.56
7.4.240.0000.00716.54
7.4.230.0050.00316.61
7.4.220.0000.00916.48
7.4.210.0090.00616.53
7.4.200.0000.00716.50
7.4.160.0130.00516.55
7.4.150.0060.01217.40
7.4.140.0120.00617.86
7.4.130.0110.01516.58
7.4.120.0120.00916.61
7.4.110.0170.00016.63
7.4.100.0070.01016.54
7.4.90.0140.00316.39
7.4.80.0140.00719.39
7.4.70.0080.01316.52
7.4.60.0030.01416.65
7.4.50.0030.01016.60
7.4.40.0070.01016.62
7.4.00.0130.00314.66
7.3.330.0000.00613.16
7.3.320.0000.00613.30
7.3.310.0000.00716.26
7.3.300.0070.00016.39
7.3.290.0090.00916.40
7.3.280.0050.01316.34
7.3.270.0090.00917.40
7.3.260.0120.00716.55
7.3.240.0110.00916.46
7.3.230.0130.00316.38
7.3.210.0080.01116.70
7.3.200.0040.01216.38
7.3.190.0060.01916.44
7.3.180.0100.00616.44
7.3.170.0190.00316.42
7.3.160.0140.00316.38
7.3.10.0040.01116.55
7.3.00.0160.00816.68
7.2.330.0070.01116.59
7.2.320.0060.01016.66
7.2.310.0070.01016.57
7.2.300.0100.01616.50
7.2.290.0140.01016.86
7.2.130.0220.01216.84
7.2.120.0240.00216.90
7.2.110.0160.00816.78
7.2.100.0180.00416.88
7.2.90.0120.01116.97
7.2.80.0140.00816.82
7.2.70.0260.00616.97
7.2.60.0140.01116.85
7.2.50.0120.01016.45
7.2.40.0160.00516.84
7.2.30.0090.01017.06
7.2.20.0280.00917.01
7.2.10.0190.00917.13
7.2.00.0320.00817.27
7.1.250.0070.01015.70
7.1.200.0040.00815.54
7.1.140.0370.01917.07
7.1.130.0340.01916.92
7.1.120.0620.00916.73
7.1.110.0460.01915.80
7.1.100.0310.01615.72
7.1.90.0460.01716.14
7.1.80.0360.01316.07
7.1.70.0480.01415.28
7.1.60.0730.00733.34
7.1.50.0660.00732.97
7.1.40.0500.02432.45
7.1.30.0950.00732.73
7.1.20.0510.02032.66
7.1.10.0610.01314.76
7.1.00.0470.01314.79

preferences:
86.56 ms | 400 KiB | 5 Q