3v4l.org

run code in 300+ PHP versions simultaneously
<?php $current_url = 'foo.bar.baz.com'; $current_domains = explode( '.', $current_url ); $current_top_domain = array_slice( $current_domains, count( $current_domains ) - 2 ); echo implode( '.', $current_top_domain );

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.0040.01416.48
8.3.50.0070.01416.63
8.3.40.0160.00018.90
8.3.30.0040.01118.59
8.3.20.0050.00320.29
8.3.10.0000.00821.82
8.3.00.0080.00019.65
8.2.180.0090.00616.38
8.2.170.0140.00722.96
8.2.160.0070.00718.94
8.2.150.0050.00324.18
8.2.140.0030.00524.66
8.2.130.0070.00019.38
8.2.120.0030.00326.35
8.2.110.0030.00621.12
8.2.100.0090.00317.77
8.2.90.0030.00619.08
8.2.80.0040.00417.97
8.2.70.0050.00317.50
8.2.60.0080.00017.80
8.2.50.0080.00018.10
8.2.40.0080.00020.66
8.2.30.0070.00019.12
8.2.20.0030.00518.04
8.2.10.0040.00418.10
8.2.00.0040.00418.10
8.1.280.0040.01125.92
8.1.270.0060.00322.19
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00019.10
8.1.230.0040.00717.70
8.1.220.0040.00417.78
8.1.210.0040.00418.77
8.1.200.0040.00417.25
8.1.190.0080.00017.00
8.1.180.0040.00418.10
8.1.170.0040.00418.37
8.1.160.0040.00419.00
8.1.150.0040.00418.93
8.1.140.0080.00019.61
8.1.130.0030.00318.80
8.1.120.0000.00717.34
8.1.110.0040.00417.30
8.1.100.0070.00017.45
8.1.90.0020.00517.46
8.1.80.0030.00517.40
8.1.70.0070.00017.36
8.1.60.0080.00017.63
8.1.50.0070.00017.42
8.1.40.0000.00717.48
8.1.30.0000.00717.64
8.1.20.0060.00717.58
8.1.10.0040.00417.49
8.1.00.0030.00517.35
8.0.300.0000.00818.77
8.0.290.0050.00316.88
8.0.280.0000.00718.43
8.0.270.0050.00317.18
8.0.260.0030.00316.81
8.0.250.0030.00316.96
8.0.240.0000.00816.79
8.0.230.0040.00416.85
8.0.220.0050.00216.69
8.0.210.0030.00516.68
8.0.200.0030.00316.89
8.0.190.0040.00416.78
8.0.180.0040.00416.84
8.0.170.0030.00316.81
8.0.160.0000.00816.75
8.0.150.0070.00016.85
8.0.140.0000.00816.87
8.0.130.0080.00013.39
8.0.120.0060.00316.88
8.0.110.0050.00216.76
8.0.100.0040.00416.83
8.0.90.0050.00316.71
8.0.80.0180.00016.89
8.0.70.0000.00816.91
8.0.60.0000.00716.68
8.0.50.0040.00416.84
8.0.30.0060.01417.08
8.0.20.0110.00817.40
8.0.10.0050.00216.92
8.0.00.0150.00916.84
7.4.330.0020.00215.55
7.4.320.0060.00016.41
7.4.300.0070.00016.64
7.4.290.0070.00016.58
7.4.280.0080.00016.50
7.4.270.0000.00716.51
7.4.260.0000.01116.50
7.4.250.0040.00416.60
7.4.240.0060.00316.52
7.4.230.0000.00716.68
7.4.220.0030.01416.70
7.4.210.0070.01016.54
7.4.200.0000.00716.35
7.4.160.0150.00316.61
7.4.150.0200.00317.40
7.4.140.0100.00917.86
7.4.130.0090.00916.45
7.4.120.0100.00816.57
7.4.110.0120.00616.50
7.4.100.0130.01016.52
7.4.90.0100.00716.43
7.4.80.0110.00719.39
7.4.70.0100.00716.49
7.4.60.0090.00916.47
7.4.50.0070.00716.51
7.4.40.0100.01016.45
7.4.30.0030.01316.43
7.4.00.0100.00614.98
7.3.330.0000.00613.11
7.3.320.0000.00612.98
7.3.310.0000.00716.37
7.3.300.0030.00316.25
7.3.290.0030.00416.28
7.3.280.0090.00716.27
7.3.270.0140.00317.40
7.3.260.0070.01216.25
7.3.250.0070.01016.32
7.3.240.0100.00616.39
7.3.230.0210.00316.50
7.3.210.0110.00716.36
7.3.200.0030.01316.54
7.3.190.0110.00616.43
7.3.180.0120.00316.17
7.3.170.0060.01616.49
7.3.160.0090.00616.29
7.3.120.0070.00715.00
7.3.110.0040.01414.93
7.3.100.0030.01014.84
7.3.90.0100.00714.54
7.3.80.0060.00915.02
7.3.70.0100.00314.88
7.3.60.0030.01014.81
7.3.50.0060.00914.59
7.3.40.0070.00714.63
7.3.30.0000.01814.86
7.3.20.0110.00716.55
7.3.10.0050.01016.66
7.3.00.0100.00616.45
7.2.330.0120.00616.55
7.2.320.0080.01516.45
7.2.310.0130.00316.73
7.2.300.0130.00316.53
7.2.290.0140.00616.44
7.2.250.0100.00614.99
7.2.240.0140.00415.16
7.2.230.0060.00914.94
7.2.220.0130.00615.15
7.2.210.0110.00815.15
7.2.200.0000.01214.93
7.2.190.0030.01214.85
7.2.180.0040.01214.86
7.2.170.0040.01415.10
7.2.130.0080.00716.88
7.2.120.0070.00816.66
7.2.110.0090.01116.64
7.2.100.0080.01116.83
7.2.90.0070.01216.68
7.2.80.0110.01016.82
7.2.70.0150.00816.91
7.2.60.0390.00316.13
7.2.50.0110.01016.80
7.2.40.0080.01016.69
7.2.30.0050.00816.75
7.2.20.0130.00416.78
7.2.10.0080.00816.78
7.2.00.0060.00617.44
7.1.330.0040.01115.93
7.1.320.0060.00615.79
7.1.310.0100.00315.54
7.1.300.0070.00715.45
7.1.290.0040.00815.52
7.1.280.0100.00315.69
7.1.270.0000.01515.73
7.1.260.0070.01015.33
7.1.250.0080.00515.56
7.1.240.0120.00615.61
7.1.230.0100.00715.52
7.1.220.0080.01115.69
7.1.210.0080.01615.71
7.1.200.0150.00215.68
7.1.190.0130.00615.62
7.1.180.0120.01215.44
7.1.170.0120.00815.56
7.1.160.0110.00715.44
7.1.150.0060.01315.36
7.1.140.0150.00215.30
7.1.130.0070.01015.44
7.1.120.0080.00815.37
7.1.110.0110.00715.56
7.1.100.0410.00512.62
7.1.90.0090.00915.56
7.1.80.0090.00615.75
7.1.70.0480.00815.45
7.1.60.0240.01224.48
7.1.50.0260.01124.26
7.1.40.0230.01623.96
7.1.30.0340.00724.13
7.1.20.0300.01024.08
7.1.10.0180.00815.09
7.1.00.0150.01215.03
7.0.330.0070.00715.40
7.0.320.0110.00815.11
7.0.310.0080.01015.32
7.0.300.0070.00814.78
7.0.290.0130.00314.84
7.0.280.0130.00714.74
7.0.270.0100.00314.88
7.0.260.0120.00415.22
7.0.250.0120.00415.42
7.0.240.0130.00315.31
7.0.230.0040.01115.09
7.0.220.0060.00914.99
7.0.210.0090.00615.49
7.0.200.0160.01115.11
7.0.190.0140.01014.98
7.0.180.0210.01414.74
7.0.170.0130.01114.72
7.0.160.0160.00814.79
7.0.150.0180.00914.62
7.0.140.0310.00714.78
7.0.130.0190.00914.92
7.0.120.0160.01215.10
7.0.110.0150.00914.79
7.0.100.0220.00514.91
7.0.90.0200.00414.83
7.0.80.0200.00714.81
7.0.70.0190.00814.95
7.0.60.0150.00914.78
7.0.50.0090.01214.88
7.0.40.0160.00913.85
7.0.30.0160.00914.02
7.0.20.0130.00813.91
7.0.10.0110.01213.83
7.0.00.0130.00913.99
5.6.380.0000.01814.39

preferences:
61.4 ms | 401 KiB | 5 Q