3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sortByDefault(array &$domains, $default='com') { $sort = array($default, 'net', 'org', 'us', 'biz', 'info'); uasort($domains, function($a, $b) use ($sort) { foreach ($sort as $tld) { if ($a['tld'] === $tld) { return -1; } elseif ($b['tld'] === $tld) { return 1; } } return strcmp($a['tld'], $b['tld']); }); return $domains; } $domains = array('google.com', 'google.net', 'google.org', 'google.us', 'google.biz', 'google.info'); // Format these into arrays so that this shitty function works. $domains = array_map(function($d) { list($name, $tld) = explode('.', $d); return array('name' => $name, 'tld' => $tld); }, $domains); var_dump(sortByDefault($domains, 'biz'));

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.40.0060.00918.53
8.3.30.0160.00019.13
8.3.20.0000.00720.38
8.3.10.0080.00023.54
8.3.00.0000.00819.26
8.2.170.0070.00722.96
8.2.160.0120.00320.29
8.2.150.0070.00024.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0040.00421.02
8.2.110.0070.00320.49
8.2.100.0060.00618.22
8.2.90.0050.00319.17
8.2.80.0030.00517.97
8.2.70.0000.00817.50
8.2.60.0080.00018.03
8.2.50.0080.00018.07
8.2.40.0090.00018.16
8.2.30.0050.00219.35
8.2.20.0040.00417.71
8.2.10.0040.00418.16
8.2.00.0000.00717.68
8.1.270.0080.00023.86
8.1.260.0040.00426.35
8.1.250.0150.00428.09
8.1.240.0050.00522.05
8.1.230.0120.00019.02
8.1.220.0030.00617.79
8.1.210.0040.00418.77
8.1.200.0000.00917.47
8.1.190.0040.00417.13
8.1.180.0000.00818.10
8.1.170.0080.00018.66
8.1.160.0000.00721.92
8.1.150.0000.00818.98
8.1.140.0000.00817.49
8.1.130.0030.00317.80
8.1.120.0030.00317.55
8.1.110.0020.00517.49
8.1.100.0000.00717.50
8.1.90.0040.00417.38
8.1.80.0040.00417.39
8.1.70.0050.00317.32
8.1.60.0090.00017.53
8.1.50.0040.00417.47
8.1.40.0040.00417.43
8.1.30.0000.00817.68
8.1.20.0070.00017.72
8.1.10.0000.00817.60
8.1.00.0040.00417.56
8.0.300.0080.00018.77
8.0.290.0090.00016.88
8.0.280.0000.00718.37
8.0.270.0000.00717.28
8.0.260.0030.00317.28
8.0.250.0030.00317.05
8.0.240.0070.00016.93
8.0.230.0020.00516.95
8.0.220.0070.00016.94
8.0.210.0000.00717.01
8.0.200.0080.00016.99
8.0.190.0000.00716.96
8.0.180.0000.00717.03
8.0.170.0030.00516.97
8.0.160.0070.00016.93
8.0.150.0070.00016.79
8.0.140.0000.00816.84
8.0.130.0000.00713.46
8.0.120.0030.00616.95
8.0.110.0000.00717.00
8.0.100.0000.00716.84
8.0.90.0000.00816.88
8.0.80.0090.00616.95
8.0.70.0040.00416.87
8.0.60.0000.00717.06
8.0.50.0040.00416.85
8.0.30.0130.00817.26
8.0.20.0060.01317.40
8.0.10.0000.00816.96
8.0.00.0110.01016.66
7.4.330.0050.00015.03
7.4.320.0070.00016.60
7.4.300.0070.00016.44
7.4.290.0030.00316.51
7.4.280.0050.00316.53
7.4.270.0040.00416.67
7.4.260.0040.00416.62
7.4.250.0040.00416.44
7.4.240.0020.00516.53
7.4.230.0050.00216.42
7.4.220.0090.01016.59
7.4.210.0170.00316.44
7.4.200.0040.00416.32
7.4.160.0050.01116.46
7.4.150.0090.00917.40
7.4.140.0150.00617.86
7.4.130.0080.01016.55
7.4.120.0170.00516.52
7.4.110.0070.01016.45
7.4.100.0130.00516.54
7.4.90.0130.00616.39
7.4.80.0060.01319.39
7.4.70.0070.01016.48
7.4.60.0110.00916.52
7.4.50.0080.00816.48
7.4.40.0230.00616.32
7.4.30.0140.01415.98
7.4.20.0120.01015.74
7.4.10.0150.00516.09
7.4.00.0060.01115.72
7.3.330.0030.00313.31
7.3.320.0030.00313.39
7.3.310.0030.00316.42
7.3.300.0030.00316.40
7.3.290.0100.00716.37
7.3.280.0120.00816.38
7.3.270.0000.01817.40
7.3.260.0140.00416.61
7.3.250.0050.01416.48
7.3.240.0110.01116.35
7.3.230.0050.01416.39
7.3.210.0100.00716.41
7.3.200.0070.01119.39
7.3.190.0070.01716.61
7.3.180.0160.00816.23
7.3.170.0170.00816.23
7.3.160.0240.00316.35
7.3.150.0140.00616.01
7.3.140.0150.00815.89
7.3.130.0090.01516.02
7.3.120.0100.00815.14
7.3.110.0120.00715.28
7.3.100.0120.00615.28
7.3.90.0100.00815.34
7.3.80.0050.01315.27
7.3.70.0090.00815.16
7.3.60.0090.00915.12
7.3.50.0090.00915.22
7.3.40.0080.00915.24
7.3.30.0130.00315.21
7.3.20.0080.01016.59
7.3.10.0090.00816.52
7.3.00.0100.00816.45
7.2.330.0080.01116.79
7.2.320.0060.01316.58
7.2.310.0230.01216.68
7.2.300.0160.01116.54
7.2.290.0180.00716.46
7.2.280.0160.00716.48
7.2.270.0170.00616.50
7.2.260.0170.00716.38
7.2.250.0090.01315.85
7.2.240.0080.01015.61
7.2.230.0100.00815.47
7.2.220.0070.00815.46
7.2.210.0070.01015.45
7.2.200.0090.00815.45
7.2.190.0110.00915.46
7.2.180.0110.00815.36
7.2.170.0080.00815.55
7.2.160.0100.00915.69
7.2.150.0140.00716.84
7.2.140.0120.00716.61
7.2.130.0090.00816.57
7.2.120.0090.00916.84
7.2.110.0090.00916.89
7.2.100.0070.01016.51
7.2.90.0100.00716.69
7.2.80.0080.00816.69
7.2.70.0070.01216.63
7.2.60.0080.01316.78
7.2.50.0110.00916.73
7.2.40.0100.00916.96
7.2.30.0110.00816.86
7.2.20.0110.00816.81
7.2.10.0110.00816.76
7.2.00.0070.00917.40
7.1.330.0090.00815.74
7.1.320.0140.00915.68
7.1.310.0060.01015.58
7.1.300.0060.01115.62
7.1.290.0070.01215.57
7.1.280.0070.00815.68
7.1.270.0090.00715.68
7.1.260.0100.00815.47
7.1.250.0110.00715.64
7.1.240.0050.01015.46
7.1.230.0080.00915.27
7.1.220.0050.01215.37
7.1.210.0100.00915.39
7.1.200.0160.00715.37
7.1.190.0070.01415.54
7.1.180.0120.00615.32
7.1.170.0130.00815.36
7.1.160.0130.00815.76
7.1.150.0160.00715.80
7.1.140.0120.00715.62
7.1.130.0130.00615.62
7.1.120.0130.00615.59
7.1.110.0120.01015.61
7.1.100.0370.00915.79
7.1.90.0190.00415.64
7.1.80.0150.00515.65
7.1.70.0070.00716.30
7.1.60.0150.00716.99
7.1.50.0130.00716.15
7.1.40.0120.00715.67
7.1.30.0130.00515.64
7.1.20.0060.01215.59
7.1.10.0050.01215.43
7.1.00.0100.02917.78
7.0.330.0090.01115.05
7.0.320.0100.00615.22
7.0.310.0080.00915.25
7.0.300.0110.00815.07
7.0.290.0150.00315.11
7.0.280.0090.01215.27
7.0.270.0130.00515.23
7.0.260.0230.00315.41
7.0.250.0090.00715.38
7.0.240.0170.00515.27
7.0.230.0100.00815.27
7.0.220.0120.00715.33
7.0.210.0250.00415.32
7.0.200.0170.00515.72
7.0.190.0150.00315.36
7.0.180.0100.00815.11
7.0.170.0100.00715.22
7.0.160.0120.00615.25
7.0.150.0260.00515.02
7.0.140.0110.02517.49
7.0.130.0100.00615.17
7.0.120.0100.00515.31
7.0.110.0100.03016.88
7.0.100.0090.02816.66
7.0.90.0100.03116.81
7.0.80.0100.03016.77
7.0.70.0120.02916.68
7.0.60.0110.02216.86
7.0.50.0100.03316.86
7.0.40.0050.02616.20
7.0.30.0050.03216.12
7.0.20.0110.02916.09
7.0.10.0070.01716.16
7.0.00.0060.03516.12
5.6.400.0120.01015.75
5.6.390.0080.01615.42
5.6.380.0120.00715.02
5.6.370.0100.00715.01
5.6.360.0110.00814.98
5.6.350.0150.00515.01
5.6.340.0110.01015.18
5.6.330.0120.01015.02
5.6.320.0120.01215.13
5.6.310.0150.01014.87
5.6.300.0070.01015.36
5.6.290.0090.01115.23
5.6.280.0130.02517.01
5.6.270.0100.00815.07
5.6.260.0110.00614.96
5.6.250.0130.02816.86
5.6.240.0060.02716.87
5.6.230.0130.02916.96
5.6.220.0100.03216.84
5.6.210.0140.03017.00
5.6.200.0090.03617.07
5.6.190.0080.03217.16
5.6.180.0070.03617.00
5.6.170.0140.03116.97
5.6.160.0140.01616.96
5.6.150.0090.03217.05
5.6.140.0100.03217.11
5.6.130.0140.02717.08
5.6.120.0070.01817.04
5.6.110.0110.02516.88
5.6.100.0050.03416.93
5.6.90.0070.03417.06
5.6.80.0100.02816.77
5.6.70.0100.03116.86
5.6.60.0090.03116.90
5.6.50.0120.02716.71
5.6.40.0150.02516.77
5.6.30.0080.03116.73
5.6.20.0150.02716.67
5.6.10.0120.03216.77
5.6.00.0070.02016.75
5.5.380.0120.02815.64
5.5.370.0060.03315.81
5.5.360.0070.03315.73
5.5.350.0120.03015.84
5.5.340.0110.03115.88
5.5.330.0070.03515.84
5.5.320.0060.03415.88
5.5.310.0070.03315.98
5.5.300.0070.03615.77
5.5.290.0090.03415.90
5.5.280.0110.03016.09
5.5.270.0120.02915.89
5.5.260.0070.03315.86
5.5.250.0100.03015.82
5.5.240.0130.02815.57
5.5.230.0030.03615.68
5.5.220.0090.03115.57
5.5.210.0090.03015.63
5.5.200.0080.03015.59
5.5.190.0060.03015.57
5.5.180.0110.02515.67
5.5.170.0120.00813.48
5.5.160.0090.02515.64
5.5.150.0090.02915.69
5.5.140.0050.03115.78
5.5.130.0070.03615.72
5.5.120.0120.02915.65
5.5.110.0050.03415.55
5.5.100.0080.03315.67
5.5.90.0140.02415.65
5.5.80.0070.02115.56
5.5.70.0050.03615.68
5.5.60.0070.02115.64
5.5.50.0080.03115.71
5.5.40.0100.02715.52
5.5.30.0180.02615.61
5.5.20.0090.03415.53
5.5.10.0070.02915.58
5.5.00.0110.02515.66
5.4.450.0110.02914.23
5.4.440.0030.02314.33
5.4.430.0080.03214.33
5.4.420.0060.03114.43
5.4.410.0040.03314.34
5.4.400.0070.01914.18
5.4.390.0110.02614.12
5.4.380.0100.02114.28
5.4.370.0100.02514.18
5.4.360.0110.02714.08
5.4.350.0090.01814.16
5.4.340.0110.02514.34
5.4.330.0060.00911.71
5.4.320.0080.01714.29
5.4.310.0090.03014.17
5.4.300.0060.03014.38
5.4.290.0090.01914.23
5.4.280.0090.03114.35
5.4.270.0060.02814.37
5.4.260.0070.02114.18
5.4.250.0120.02114.09
5.4.240.0100.02714.18
5.4.230.0070.02714.04
5.4.220.0060.03414.32
5.4.210.0040.02614.28
5.4.200.0100.02814.17
5.4.190.0050.03214.21
5.4.180.0100.01814.23
5.4.170.0080.01814.21
5.4.160.0080.02814.02
5.4.150.0100.02214.16
5.4.140.0050.03013.30
5.4.130.0080.02913.33
5.4.120.0090.02813.39
5.4.110.0020.03613.41
5.4.100.0040.02913.43
5.4.90.0110.02213.19
5.4.80.0070.02713.47
5.4.70.0060.02713.54
5.4.60.0050.02813.47
5.4.50.0070.02513.33
5.4.40.0030.02213.35
5.4.30.0110.02413.24
5.4.20.0100.02413.37
5.4.10.0120.02613.31
5.4.00.0060.02913.07
5.3.290.0070.02712.84
5.3.280.0040.03112.83
5.3.270.0100.02712.78
5.3.260.0040.02212.81
5.3.250.0030.02812.94
5.3.240.0050.03112.72
5.3.230.0130.02612.63
5.3.220.0080.02112.58
5.3.210.0030.02012.68
5.3.200.0060.02612.69
5.3.190.0060.02912.78
5.3.180.0020.02312.85
5.3.170.0050.02312.80
5.3.160.0080.01612.75
5.3.150.0090.01712.78
5.3.140.0090.02912.70
5.3.130.0100.03212.74
5.3.120.0050.03112.80
5.3.110.0080.02712.80
5.3.100.0100.02712.65
5.3.90.0070.02612.63
5.3.80.0040.01912.53
5.3.70.0050.03012.47
5.3.60.0050.02812.56
5.3.50.0100.01612.59
5.3.40.0060.03012.62
5.3.30.0110.02512.55
5.3.20.0110.02112.52
5.3.10.0080.02612.33
5.3.00.0100.02812.23
5.2.170.0060.02410.83
5.2.160.0070.01410.85
5.2.150.0040.02110.75
5.2.140.0050.02510.81
5.2.130.0070.02310.74
5.2.120.0080.02410.75
5.2.110.0050.02410.75
5.2.100.0100.02010.84
5.2.90.0040.02710.77
5.2.80.0100.02310.75
5.2.70.0050.02510.79
5.2.60.0080.02610.75
5.2.50.0060.02110.71
5.2.40.0050.02610.67
5.2.30.0070.01410.80
5.2.20.0050.02510.58
5.2.10.0080.02210.70
5.2.00.0080.02110.58
5.1.60.0050.02210.06
5.1.50.0090.01910.11
5.1.40.0050.01610.08
5.1.30.0040.02010.33
5.1.20.0040.02210.29
5.1.10.0070.01710.08
5.1.00.0100.01910.05
5.0.50.0080.0159.37
5.0.40.0060.0179.35
5.0.30.0080.0229.26
5.0.20.0070.0149.30
5.0.10.0050.0179.24
5.0.00.0040.0249.23
4.4.90.0030.0159.23
4.4.80.0010.0139.23
4.4.70.0040.0129.23
4.4.60.0020.0159.23
4.4.50.0040.0139.23
4.4.40.0020.0179.23
4.4.30.0050.0129.23
4.4.20.0020.0159.23
4.4.10.0020.0119.23
4.4.00.0040.0199.23
4.3.110.0010.0159.23
4.3.100.0030.0139.23
4.3.90.0050.0079.23
4.3.80.0030.0189.23
4.3.70.0060.0069.23
4.3.60.0040.0139.23
4.3.50.0030.0179.23
4.3.40.0030.0209.23
4.3.30.0040.0119.23
4.3.20.0030.0139.23
4.3.10.0030.0159.23
4.3.00.0010.0129.23

preferences:
47.55 ms | 400 KiB | 5 Q