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]; } echo get_host('https://google.com'); // google.com echo "\n"; echo get_host('https://www.google.com'); // google.com echo "\n"; echo get_host('https://sub1.sub2.google.com'); // google.com echo "\n"; echo get_host('http://localhost'); // localhost

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.4.140.0130.00917.64
8.4.130.0100.01118.66
8.4.120.0070.00217.63
8.4.110.0130.00919.60
8.4.100.0170.00417.55
8.4.90.0110.01020.73
8.4.80.0080.01118.96
8.4.70.0020.00619.05
8.4.60.0120.00918.48
8.4.50.0100.01017.90
8.4.40.0070.01317.42
8.4.30.0100.00717.51
8.4.20.0060.01019.79
8.4.10.0040.00419.50
8.3.270.0220.00416.74
8.3.260.0120.00316.61
8.3.250.0120.00718.38
8.3.240.0110.00516.80
8.3.230.0100.01116.23
8.3.220.0130.00518.87
8.3.210.0100.00516.80
8.3.200.0090.00316.53
8.3.190.0090.00918.63
8.3.180.0110.00716.76
8.3.170.0120.00619.02
8.3.160.0130.00618.32
8.3.150.0100.01020.60
8.3.140.0040.00416.52
8.3.130.0060.00316.55
8.3.120.0060.00318.85
8.3.110.0070.00020.94
8.3.100.0040.00424.06
8.3.90.0040.00426.77
8.3.80.0240.00726.06
8.3.70.0230.00726.08
8.3.60.0230.00726.70
8.3.50.0110.00724.07
8.3.40.0180.00626.76
8.3.30.0190.00626.81
8.3.20.0150.00627.38
8.3.10.0120.00528.46
8.3.00.0110.00528.39
8.2.290.0120.00716.69
8.2.280.0020.00718.24
8.2.270.0060.01217.25
8.2.260.0100.00718.96
8.2.250.0000.00816.41
8.2.240.0050.00518.94
8.2.230.0040.00422.58
8.2.220.0000.00937.54
8.2.210.0030.00526.77
8.2.200.0130.00726.06
8.2.190.0170.00726.14
8.2.180.0150.00526.61
8.2.170.0130.00528.21
8.2.160.0160.00526.98
8.2.150.0170.00328.62
8.2.140.0150.00528.78
8.2.130.0140.00426.98
8.2.120.0140.00629.34
8.2.110.0180.00427.44
8.2.100.0090.00626.50
8.2.90.0120.00627.01
8.2.80.0120.00426.55
8.2.70.0110.00626.53
8.2.60.0090.00426.58
8.2.50.0140.00126.63
8.2.40.0140.00227.40
8.2.30.0120.00226.97
8.2.20.0090.00626.59
8.2.10.0120.00226.60
8.2.00.0120.00426.65
8.1.330.0120.00716.34
8.1.320.0130.00617.88
8.1.310.0040.00416.67
8.1.300.0100.01016.05
8.1.290.0230.00726.85
8.1.280.0150.00729.20
8.1.270.0200.00427.90
8.1.260.0110.00729.34
8.1.250.0130.00729.92
8.1.240.0190.00327.96
8.1.230.0160.00726.44
8.1.220.0160.00726.47
8.1.210.0160.00726.81
8.1.200.0220.00026.30
8.1.190.0140.00926.22
8.1.180.0130.00826.59
8.1.170.0120.00626.71
8.1.160.0130.00226.87
8.1.150.0120.00226.88
8.1.140.0110.00326.89
8.1.130.0120.00526.47
8.1.120.0170.00426.36
8.1.110.0150.00826.33
8.1.100.0150.00826.39
8.1.90.0160.00626.37
8.1.80.0140.00726.36
8.1.70.0140.00726.38
8.1.60.0210.00426.42
8.1.50.0140.00926.41
8.1.40.0160.00726.36
8.1.30.0170.00526.43
8.1.20.0170.00726.42
8.1.10.0130.00926.42
8.1.00.0180.00526.36
8.0.300.0170.00526.81
8.0.290.0200.00226.14
8.0.280.0140.01126.67
8.0.270.0150.00626.29
8.0.260.0170.00726.31
8.0.250.0180.00426.19
8.0.240.0120.00726.20
8.0.230.0200.00326.22
8.0.220.0150.00726.16
8.0.210.0140.00626.18
8.0.200.0150.00526.20
8.0.190.0260.00526.18
8.0.180.0170.00526.16
8.0.170.0160.00726.14
8.0.160.0190.00426.18
8.0.150.0170.00726.14
8.0.140.0190.00426.17
8.0.130.0170.00425.01
8.0.120.0150.00426.14
8.0.110.0150.00526.20
8.0.100.0140.00826.21
8.0.90.0170.00626.20
8.0.80.0190.00826.18
8.0.70.0170.00426.21
8.0.60.0190.00326.18
8.0.50.0130.00826.21
8.0.30.0190.00422.64
8.0.20.0140.01021.25
8.0.10.0130.00526.17
8.0.00.0120.00623.72
7.4.330.0090.00525.74
7.4.320.0170.00426.09
7.4.300.0190.00226.10
7.4.290.0150.00426.07
7.4.280.0150.00526.06
7.4.270.0180.00226.09
7.4.260.0140.00726.10
7.4.250.0160.00526.04
7.4.240.0130.00726.03
7.4.230.0150.00526.12
7.4.220.0160.01026.03
7.4.210.0150.00926.05
7.4.200.0150.00426.03
7.4.190.0190.00730.84
7.4.180.0190.00730.84
7.4.160.0170.00523.64
7.4.150.0190.00626.36
7.4.140.0160.00722.18
7.4.130.0210.00226.10
7.4.120.0130.00920.56
7.4.110.0150.00623.70
7.4.100.0200.00223.60
7.4.90.0140.00723.55
7.4.80.0160.00624.38
7.4.70.0110.01123.68
7.4.60.0140.00823.62
7.4.50.0160.00923.57
7.4.40.0200.00423.71
7.4.30.0150.01026.08
7.4.20.0200.00726.09
7.4.10.0210.00526.07
7.4.00.0140.00621.63
7.3.330.0120.00724.96
7.3.320.0160.00325.01
7.3.310.0180.00125.97
7.3.300.0170.00325.95
7.3.290.0120.00622.14
7.3.280.0170.00625.97
7.3.270.0150.00626.36
7.3.260.0130.00822.19
7.3.250.0150.00622.19
7.3.240.0200.00323.66
7.3.230.0180.00723.57
7.3.220.0160.00926.01
7.3.210.0150.00723.57
7.3.200.0150.00823.65
7.3.190.0160.00723.59
7.3.180.0170.00723.63
7.3.170.0180.00523.66
7.3.160.0130.00923.63
7.3.150.0190.00526.06
7.3.140.0200.00425.98
7.3.130.0160.00826.00
7.3.120.0160.00623.28
7.3.110.0150.00623.17
7.3.100.0120.00823.21
7.3.90.0110.00923.21
7.3.80.0150.00523.28
7.3.70.0120.00823.23
7.3.60.0150.00723.24
7.3.50.0140.00523.22
7.3.40.0140.00623.22
7.3.30.0140.00523.31
7.3.20.0180.00623.68
7.3.10.0120.00722.29
7.3.00.0130.00822.31
7.2.340.0220.00526.08
7.2.330.0150.01123.63
7.2.320.0160.00623.75
7.2.310.0190.00423.68
7.2.300.0150.00923.71
7.2.290.0110.01123.75
7.2.280.0180.00826.05
7.2.270.0160.00926.08
7.2.260.0200.00726.05
7.2.250.0170.00523.32
7.2.240.0150.00623.33
7.2.230.0120.00723.36
7.2.220.0140.00423.36
7.2.210.0140.00623.30
7.2.200.0120.00923.38
7.2.190.0160.00523.41
7.2.180.0120.00823.40
7.2.170.0140.00723.30
7.2.160.0110.01126.14
7.2.150.0150.00926.18
7.2.140.0170.00626.19
7.2.130.0130.00823.75
7.2.120.0130.00823.85
7.2.110.0140.00823.79
7.2.100.0110.00623.77
7.2.90.0260.01022.04
7.2.80.0290.01022.06
7.2.70.0280.00622.05
7.2.60.0220.00921.16
7.2.50.0280.00621.24
7.2.40.0300.00922.01
7.2.30.0270.00922.06
7.2.20.0340.00422.01
7.2.10.0330.00921.24
7.2.00.0260.00721.27
7.1.330.0180.00623.30
7.1.320.0140.00723.28
7.1.310.0090.01123.34
7.1.300.0180.00523.20
7.1.290.0150.00623.20
7.1.280.0130.00723.20
7.1.270.0170.00623.31
7.1.260.0190.00423.25
7.1.250.0160.00423.21
7.1.240.0140.00925.82
7.1.230.0210.00525.70
7.1.220.0130.01325.72
7.1.210.0380.00622.80
7.1.200.0270.00621.42
7.1.190.0340.00722.76
7.1.180.0460.00522.75
7.1.170.0340.00722.71
7.1.160.0380.00822.81
7.1.150.0410.00522.71
7.1.140.0430.00722.74
7.1.130.0370.00921.56
7.1.120.0340.00821.56
7.1.110.0360.00821.49
7.1.100.0390.00421.32
7.1.90.0430.00821.38
7.1.80.0250.00821.41
7.1.70.0290.00821.25
7.1.60.0430.00928.51
7.1.50.0390.01028.43
7.1.40.0420.01128.32
7.1.30.0480.01028.36
7.1.20.0350.00728.32
7.1.10.0400.00621.07
7.1.00.0340.00821.19
7.0.330.0180.00825.65
7.0.320.0190.00125.61
7.0.310.0430.00422.58
7.0.300.0420.00922.60
7.0.290.0390.01022.61
7.0.280.0320.00622.48
7.0.270.0600.00621.29
7.0.260.0460.00721.38
7.0.250.0370.00721.12
7.0.240.0370.00721.14
7.0.230.0390.00721.23
7.0.220.0510.00721.29
7.0.210.0280.00921.06
7.0.200.0290.00721.03
7.0.190.0460.00821.07
7.0.180.0380.00920.92
7.0.170.0250.01020.97
7.0.160.0460.00720.92
7.0.150.0300.01120.94
7.0.140.0310.01020.92
7.0.130.0300.00720.97
7.0.120.0370.00821.02
7.0.110.0430.00621.00
7.0.100.0350.01020.97
7.0.90.0300.00720.85
7.0.80.0320.00920.96
7.0.70.0380.00820.99
7.0.60.0400.00720.89
7.0.50.0450.00720.99
7.0.40.0370.00620.96
7.0.30.0400.00821.05
7.0.20.0310.00920.99
7.0.10.0390.00721.02
7.0.00.0330.00720.90
5.6.400.0230.00825.87
5.6.390.0200.01125.91
5.6.380.0210.00925.82
5.6.370.0230.00825.94
5.6.360.0200.01025.93
5.6.350.0240.00725.81
5.6.340.0200.01125.92
5.6.330.0250.00725.85
5.6.320.0260.00826.00
5.6.310.0210.00825.94
5.6.300.0110.02622.59
5.6.290.0200.01522.56
5.6.280.0190.01822.59
5.6.270.0180.01822.55
5.6.260.0180.01622.50
5.6.250.0160.02022.59
5.6.240.0210.01522.58
5.6.230.0170.01722.54
5.6.220.0180.01822.58
5.6.210.0150.01822.52
5.6.200.0170.02022.50
5.6.190.0190.02022.49
5.6.180.0200.01422.59
5.6.170.0220.01422.55
5.6.160.0210.01822.55
5.6.150.0200.01722.55
5.6.140.0170.01722.55
5.6.130.0200.01522.58
5.6.120.0120.02122.58
5.6.110.0190.01722.59
5.6.100.0180.01422.61
5.6.90.0150.01722.62
5.6.80.0190.01222.44
5.6.70.0170.01422.38
5.6.60.0140.01822.40
5.6.50.0170.01422.45
5.6.40.0210.01622.39
5.6.30.0140.02322.43
5.6.20.0160.02322.38
5.6.10.0230.01622.41
5.6.00.0180.01722.37

preferences:
31.51 ms | 403 KiB | 5 Q