3v4l.org

run code in 500+ PHP versions simultaneously
<?php function get_host($url) { $host = parse_url($url, PHP_URL_HOST); $names = explode(".", $host); if(count($names) == 1) { return $names[0]; } $names = array_reverse($names); return $names[1] . '.' . $names[0]; } // Output for 5.6.0 echo get_host('http://www.site1.com/perma/doom-rock.htm'); // site1.com echo "\n"; echo get_host('http://www.site2.net/mod/doom.html'); // site2.net echo "\n"; echo get_host('https://www.site3.com/m/doom-rock'); // site3.com echo "\n"; echo get_host('http://site4.com/doom'); // site4.com echo "\n"; echo get_host('http://site5.com/doom'); // site5.com

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.5.30.0090.00917.48
8.5.20.0130.00519.38
8.5.10.0120.01016.86
8.5.00.0130.01019.90
8.4.180.0120.00825.74
8.4.170.0130.00923.82
8.4.160.0170.00823.92
8.4.150.0090.00316.79
8.4.140.0140.00717.39
8.4.130.0140.00617.58
8.4.120.0060.00424.34
8.4.110.0150.00622.23
8.4.100.0080.00217.69
8.4.90.0090.01218.84
8.4.80.0130.00719.64
8.4.70.0120.00817.80
8.4.60.0030.00620.59
8.4.50.0130.00817.55
8.4.40.0040.00417.73
8.4.30.0160.00320.39
8.4.20.0110.00017.88
8.4.10.0000.00919.48
8.3.300.0130.00724.40
8.3.290.0150.00718.59
8.3.280.0130.00818.39
8.3.270.0090.00916.61
8.3.260.0120.00716.36
8.3.250.0130.00519.01
8.3.240.0090.00918.65
8.3.230.0050.00416.80
8.3.220.0040.00417.34
8.3.210.0130.00616.85
8.3.200.0130.00716.54
8.3.190.0030.00617.19
8.3.180.0070.00216.49
8.3.170.0140.00416.63
8.3.160.0080.00018.39
8.3.150.0140.00418.99
8.3.140.0110.00720.63
8.3.130.0000.00918.42
8.3.120.0100.00019.12
8.3.110.0040.00420.94
8.3.100.0100.00016.59
8.3.90.0000.00826.77
8.3.80.0030.00616.50
8.3.70.0090.00618.56
8.3.60.0150.00416.75
8.3.50.0100.00718.38
8.3.40.0140.00720.43
8.3.30.0150.00018.85
8.3.20.0000.00824.18
8.3.10.0000.00824.66
8.3.00.0040.00426.16
8.2.300.0110.00918.03
8.2.290.0080.01120.80
8.2.280.0040.00518.47
8.2.270.0060.00918.39
8.2.260.0080.00016.90
8.2.250.0160.00018.42
8.2.240.0000.00817.31
8.2.230.0000.00822.58
8.2.220.0090.00024.06
8.2.210.0050.00226.77
8.2.200.0090.00016.88
8.2.190.0150.00416.75
8.2.180.0110.00725.92
8.2.170.0140.00018.83
8.2.160.0110.00422.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0090.00019.38
8.2.110.0030.00720.38
8.2.100.0030.00620.52
8.1.340.0140.00617.57
8.1.330.0110.00723.46
8.1.320.0090.01016.05
8.1.310.0080.00016.35
8.1.300.0000.00818.54
8.1.290.0030.00630.84
8.1.280.0070.00725.92
8.1.270.0040.00423.84
8.1.260.0030.00526.35
8.1.250.0050.00328.09
8.1.240.0070.00318.58
8.1.230.0060.00322.15
5.6.00.0060.00215.78

preferences:
86.59 ms | 849 KiB | 5 Q