3v4l.org

run code in 300+ 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.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.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.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:
29.53 ms | 400 KiB | 5 Q