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.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.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.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:
25.43 ms | 403 KiB | 5 Q