3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function get_domain($url) { if ( !preg_match("/^http/", $url) ) $url = 'http://' . $url; if ( $url[strlen($url)-1] != '/' ) $url .= '/'; $pieces = parse_url($url); $domain = isset($pieces['host']) ? $pieces['host'] : ''; if ( preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}?\.[a-z\.]{2,6})$/i', $domain, $regs) ) { $res = preg_replace('/^www\./', '', $regs['domain'] ); return $res; } return false; } var_dump(get_domain('Wmcareers.net'));

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.60.0040.01517.04
7.2.00.0230.01318.80
7.1.200.0060.00816.06
7.1.100.0060.00918.34
7.1.70.0030.01017.39
7.1.60.0160.00619.70
7.1.50.0100.01617.10
7.1.00.0000.08022.35
7.0.200.0060.00316.63
7.0.140.0070.07022.07
7.0.60.0070.03721.77
7.0.50.0070.08017.93
7.0.40.0070.08720.29
7.0.30.0130.04720.27
7.0.20.0200.08020.14
7.0.10.0100.05720.04
7.0.00.0070.06020.07
5.6.280.0100.07021.07
5.6.210.0170.07720.47
5.6.200.0100.08018.19
5.6.190.0030.04320.33
5.6.180.0330.07720.51
5.6.170.0270.05020.47
5.6.160.0030.04320.57
5.6.150.0130.04718.19
5.6.140.0070.04018.18
5.6.130.0030.04718.21
5.6.120.0130.07321.12
5.6.110.0070.06021.03
5.6.100.0170.08020.86
5.6.90.0100.07321.01
5.6.80.0070.07320.36
5.5.350.4400.04020.34
5.5.340.0030.05318.04
5.5.330.0100.08320.31
5.5.320.0270.07020.24
5.5.310.0300.07020.24
5.5.300.0100.08717.98
5.5.290.0070.03717.94
5.5.280.0130.08020.80
5.5.270.0070.06720.76
5.5.260.0030.07320.80
5.5.250.0100.04020.59
5.5.240.0170.07320.07
5.4.450.3530.04319.44
5.4.440.0130.07719.44
5.4.430.1630.04019.27
5.4.420.3870.03319.27
5.4.410.4130.03319.31
5.4.400.4570.03719.02
5.4.390.3870.03319.17
5.4.380.4030.03318.91
5.4.370.3670.02719.01
5.4.360.3730.03719.16
5.4.350.4200.03319.02
5.4.340.4730.03319.16
5.4.320.4370.03018.91
5.4.310.4630.04018.95
5.4.300.3630.03718.92
5.4.290.3370.04019.12
5.4.280.3730.03718.95
5.4.270.2770.04019.17
5.4.260.2900.04018.95
5.4.250.3730.03019.10
5.4.240.4400.04019.15
5.4.230.3170.03318.89
5.4.220.3570.03719.16
5.4.210.3930.03019.17
5.4.200.3900.03718.94
5.4.190.5000.04019.14
5.4.180.4530.04019.11
5.4.170.4500.04018.89
5.4.160.4670.03718.88
5.4.150.1830.03719.05
5.4.140.0070.04016.45
5.4.130.4500.04016.49
5.4.120.4730.03016.50
5.4.110.4700.03316.61
5.4.100.4430.02716.36
5.4.90.4430.02716.33
5.4.80.4600.03316.41
5.4.70.4600.03716.54
5.4.60.4530.03716.57
5.4.50.0630.03716.43
5.4.40.0070.07316.37
5.4.30.1730.06016.36
5.4.20.4600.03716.43
5.4.10.4570.05016.16
5.4.00.4530.04015.96
5.3.290.4670.03714.71
5.3.280.3000.04314.64
5.3.270.4170.03314.77
5.3.260.4600.03014.63
5.3.250.0070.06314.64
5.3.240.0070.04314.69
5.3.230.4470.03014.63
5.3.220.4530.03314.57
5.3.210.4570.03314.56
5.3.200.4600.03714.71
5.3.190.4570.04014.61
5.3.180.4730.03014.59
5.3.170.4630.04714.57
5.3.160.4500.04014.57
5.3.150.4700.03014.56
5.3.140.0130.07714.47
5.3.130.4700.04014.72
5.3.120.4670.03714.61
5.3.110.4700.03014.54
5.3.100.4700.03013.93
5.3.90.4370.03314.02
5.3.80.4300.04013.96
5.3.70.4300.03314.02
5.3.60.4730.04014.16
5.3.50.3930.03013.94
5.3.40.3770.03713.94
5.3.30.3970.04013.98
5.3.20.4070.04313.76
5.3.10.4630.03313.68
5.3.00.4300.03313.52
5.2.170.3400.02711.18
5.2.160.2730.02711.15
5.2.150.3170.03011.09
5.2.140.3170.02711.21
5.2.130.3630.02711.02
5.2.120.3770.03011.25
5.2.110.3530.03011.08
5.2.100.3130.02711.14
5.2.90.2970.03010.99
5.2.80.3700.02711.25
5.2.70.3200.03011.15
5.2.60.3500.03011.06
5.2.50.3330.03311.02
5.2.40.2700.03311.05
5.2.30.3100.03010.98
5.2.20.3300.02711.14
5.2.10.3230.02710.87
5.2.00.3130.03010.75
5.1.60.3070.02310.05
5.1.50.3270.0239.97
5.1.40.3130.02010.04
5.1.30.3270.02310.30
5.1.20.3270.02010.38
5.1.10.3100.02010.05
5.1.00.3100.02710.14
5.0.50.1870.0208.45
5.0.40.1800.0278.47
5.0.30.1800.0308.25
5.0.20.1870.0208.15
5.0.10.1870.0178.22
5.0.00.1870.0278.21
4.4.90.1500.0176.04
4.4.80.1370.0206.07
4.4.70.1570.0206.08
4.4.60.1870.0136.08
4.4.50.1630.0106.08
4.4.40.1830.0236.08
4.4.30.1530.0176.08
4.4.20.2170.0206.08
4.4.10.1830.0136.08
4.4.00.1600.0206.08
4.3.110.1600.0206.08
4.3.100.1600.0176.08
4.3.90.1800.0176.08
4.3.80.1470.0276.08
4.3.70.1830.0176.08
4.3.60.1870.0136.08
4.3.50.1830.0106.08
4.3.40.1670.0206.08
4.3.30.0670.0176.08
4.3.20.0700.0176.08
4.3.10.0770.0176.08
4.3.00.1000.0206.08