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); sortByDefault($domains, 'biz'); var_dump($domains);

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.0150.00018.63
8.3.30.0110.00419.22
8.3.20.0000.00820.30
8.3.10.0040.00423.70
8.3.00.0030.00519.38
8.2.170.0090.00622.96
8.2.160.0040.01120.41
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0110.00426.16
8.2.120.0040.00421.02
8.2.110.0060.00320.38
8.2.100.0060.00618.22
8.2.90.0040.00419.22
8.2.80.0080.00017.97
8.2.70.0060.00317.63
8.2.60.0040.00418.05
8.2.50.0030.00618.07
8.2.40.0040.00818.28
8.2.30.0040.00419.34
8.2.20.0000.00817.70
8.2.10.0040.00418.15
8.2.00.0060.00317.83
8.1.270.0040.00423.97
8.1.260.0040.00426.35
8.1.250.0040.01428.09
8.1.240.0060.00323.97
8.1.230.0080.00419.09
8.1.220.0080.00017.76
8.1.210.0050.00318.77
8.1.200.0030.00617.36
8.1.190.0040.00417.35
8.1.180.0000.00819.13
8.1.170.0040.00418.50
8.1.160.0040.00421.95
8.1.150.0110.00018.97
8.1.140.0040.00417.39
8.1.130.0070.00017.77
8.1.120.0000.00717.49
8.1.110.0040.00417.43
8.1.100.0030.00517.49
8.1.90.0040.00417.50
8.1.80.0050.00317.46
8.1.70.0040.00417.34
8.1.60.0030.00617.59
8.1.50.0040.00417.56
8.1.40.0080.00017.41
8.1.30.0040.00417.62
8.1.20.0040.00417.50
8.1.10.0000.00717.66
8.1.00.0000.00817.43
8.0.300.0040.00418.77
8.0.290.0050.00216.75
8.0.280.0040.00418.38
8.0.270.0000.00717.18
8.0.260.0000.00617.28
8.0.250.0030.00316.93
8.0.240.0000.00717.02
8.0.230.0040.00416.93
8.0.220.0030.00316.87
8.0.210.0030.00316.88
8.0.200.0050.00216.94
8.0.190.0050.00316.90
8.0.180.0070.00017.00
8.0.170.0040.00416.92
8.0.160.0000.00717.07
8.0.150.0000.00716.79
8.0.140.0000.00716.82
8.0.130.0080.00013.39
8.0.120.0050.00316.83
8.0.110.0050.00216.90
8.0.100.0000.00716.88
8.0.90.0000.00716.95
8.0.80.0040.01216.90
8.0.70.0040.00416.89
8.0.60.0040.00416.83
8.0.50.0000.00816.92
8.0.30.0070.01617.13
8.0.20.0080.01317.40
8.0.10.0000.00717.07
8.0.00.0090.00916.79
7.4.330.0000.00515.00
7.4.320.0060.00016.58
7.4.300.0030.00316.58
7.4.290.0030.00316.61
7.4.280.0070.00016.53
7.4.270.0030.00316.64
7.4.260.0060.00316.53
7.4.250.0040.00416.59
7.4.240.0020.00516.57
7.4.230.0040.00416.65
7.4.220.0160.01216.66
7.4.210.0070.00716.56
7.4.200.0040.00416.52
7.4.160.0120.00416.64
7.4.150.0040.01417.40
7.4.140.0120.00517.86
7.4.130.0080.01016.57
7.4.120.0050.01216.53
7.4.110.0090.00916.67
7.4.100.0070.01016.50
7.4.90.0070.01116.52
7.4.80.0120.01419.39
7.4.70.0080.00816.74
7.4.60.0110.01016.39
7.4.50.0100.00516.33
7.4.40.0160.00616.36
7.4.30.0170.00716.49
7.4.20.0160.00816.27
7.4.10.0130.00915.92
7.4.00.0090.00815.66
7.3.330.0000.00513.37
7.3.320.0000.00613.30
7.3.310.0040.00416.41
7.3.300.0060.00016.39
7.3.290.0100.01016.35
7.3.280.0110.00516.38
7.3.270.0170.00817.40
7.3.260.0110.00616.45
7.3.250.0110.00816.33
7.3.240.0050.01316.41
7.3.230.0130.00616.62
7.3.210.0100.00716.50
7.3.200.0120.00619.39
7.3.190.0140.00516.43
7.3.180.0120.01216.21
7.3.170.0110.01116.47
7.3.160.0130.01016.41
7.3.150.0130.01016.05
7.3.140.0180.00416.26
7.3.130.0140.00815.81
7.3.120.0110.01015.84
7.3.110.0100.01115.54
7.3.100.0180.00815.51
7.3.90.0090.01215.53
7.3.80.0100.00715.34
7.3.70.0160.00715.61
7.3.60.0160.00715.57
7.3.50.0100.01515.69
7.3.40.0180.00515.46
7.3.30.0120.00915.51
7.3.20.0180.00216.43
7.3.10.0120.01016.54
7.3.00.0120.01116.43
7.2.330.0060.01216.80
7.2.320.0120.00616.60
7.2.310.0120.01316.52
7.2.300.0160.00816.29
7.2.290.0130.01016.83
7.2.280.0170.00716.62
7.2.270.0200.00716.36
7.2.260.0230.00415.90
7.2.250.0090.01315.86
7.2.240.0160.00715.80
7.2.230.0120.01215.95
7.2.220.0140.00915.88
7.2.210.0080.00915.66
7.2.200.0160.00715.72
7.2.190.0170.00515.80
7.2.180.0150.00815.77
7.2.170.0180.00915.82
7.2.160.0160.00615.97
7.2.150.0100.01316.69
7.2.140.0160.00816.70
7.2.130.0110.01216.84
7.2.120.0130.00716.83
7.2.110.0130.00816.77
7.2.100.0110.00616.85
7.2.90.0110.00816.81
7.2.80.0070.01116.86
7.2.70.0120.00916.60
7.2.60.0090.00816.87
7.2.50.0060.01216.86
7.2.40.0100.00616.83
7.2.30.0110.00616.93
7.2.20.0130.00616.85
7.2.10.0050.01316.76
7.2.00.0070.00817.45
7.1.330.0120.00915.69
7.1.320.0110.01115.59
7.1.310.0120.00915.71
7.1.300.0170.00515.69
7.1.290.0310.00715.70
7.1.280.0140.00715.55
7.1.270.0140.00815.78
7.1.260.0230.00415.60
7.1.250.0150.00515.77
7.1.240.0120.00715.66
7.1.230.0090.00615.63
7.1.220.0070.01015.57
7.1.210.0090.00915.71
7.1.200.0110.01115.75
7.1.190.0090.00915.75
7.1.180.0110.00515.59
7.1.170.0090.00715.73
7.1.160.0100.00615.72
7.1.150.0070.00715.79
7.1.140.0100.00615.63
7.1.130.0110.00615.67
7.1.120.0140.00315.63
7.1.110.0040.01115.69
7.1.100.0350.00815.85
7.1.90.0060.01115.73
7.1.80.0100.01015.77
7.1.70.0090.00816.12
7.1.60.0090.00816.14
7.1.50.0050.01115.96
7.1.40.0090.00816.08
7.1.30.0110.00815.90
7.1.20.0110.00915.93
7.1.10.0080.00815.97
7.1.00.0090.00715.82
7.0.330.0130.00815.34
7.0.320.0080.00815.17
7.0.310.0120.00315.30
7.0.300.0050.01015.25
7.0.290.0130.00515.39
7.0.280.0080.00615.36
7.0.270.0090.00615.39
7.0.260.0100.00915.25
7.0.250.0050.01115.31
7.0.240.0100.00615.47
7.0.230.0110.00515.46
7.0.220.0110.00715.29
7.0.210.0090.00615.38
7.0.200.0070.00915.68
7.0.190.0050.01115.63
7.0.180.0140.00615.62
7.0.170.0100.00615.66
7.0.160.0060.01015.47
7.0.150.0150.00815.68
7.0.140.0090.00815.66
7.0.130.0050.00915.66
7.0.120.0060.01115.66
7.0.110.0060.00915.61
7.0.100.0110.00515.65
7.0.90.0080.00715.68
7.0.80.0090.00615.68
7.0.70.0070.00815.59
7.0.60.0100.00715.61
7.0.50.0090.00615.59
7.0.40.0060.00814.37
7.0.30.0100.00614.36
7.0.20.0060.00914.36
7.0.10.0070.00814.31
7.0.00.0070.00714.34
5.6.400.0150.00915.20
5.6.390.0120.00815.19
5.6.380.0070.01115.06
5.6.370.0040.01314.93
5.6.360.0070.01014.95
5.6.350.0080.00714.98
5.6.340.0100.00815.21
5.6.330.0110.00715.02
5.6.320.0090.00714.92
5.6.310.0070.01014.93
5.6.300.0050.01916.55
5.6.290.0100.01716.42
5.6.280.0080.02816.33
5.6.270.0100.02416.37
5.6.260.0060.01816.36
5.6.250.0070.01816.46
5.6.240.0080.03216.33
5.6.230.0090.01616.49
5.6.220.0060.02616.33
5.6.210.0080.01816.25
5.6.200.0090.01716.43
5.6.190.0100.01916.38
5.6.180.0080.01916.49
5.6.170.0100.01716.33
5.6.160.0110.01816.30
5.6.150.0070.01716.30
5.6.140.0100.02416.37
5.6.130.0090.01616.32
5.6.120.0070.01916.61
5.6.110.0100.01716.51
5.6.100.0090.01816.40
5.6.90.0110.01316.34
5.6.80.0090.01516.16
5.6.70.0090.01516.16
5.6.60.0050.02016.14
5.6.50.0110.01516.24
5.6.40.0080.01716.23
5.6.30.0130.01316.19
5.6.20.0090.01816.20
5.6.10.0110.01416.18
5.6.00.0100.01816.24
5.5.380.0070.01815.25
5.5.370.0100.01615.21
5.5.360.0070.01815.16
5.5.350.0110.01315.10
5.5.340.0060.01615.28
5.5.330.0070.01815.42
5.5.320.0090.01615.36
5.5.310.0090.01715.33
5.5.300.0100.01515.33
5.5.290.0070.01615.40
5.5.280.0060.01815.35
5.5.270.0100.01515.29
5.5.260.0110.01315.43
5.5.250.0070.02015.36
5.5.240.0040.02115.12
5.5.230.0100.01615.26
5.5.220.0090.01415.17
5.5.210.0090.01515.17
5.5.200.0050.02015.12
5.5.190.0070.01615.19
5.5.180.0080.01815.30
5.5.170.0080.00914.34
5.5.160.0080.01815.14
5.5.150.0090.01315.09
5.5.140.0070.01615.16
5.5.130.0060.02715.27
5.5.120.0090.01515.13
5.5.110.0080.01615.09
5.5.100.0060.01715.09
5.5.90.0120.01915.11
5.5.80.0090.01615.19
5.5.70.0060.01915.17
5.5.60.0060.01715.15
5.5.50.0080.01715.19
5.5.40.0080.01915.08
5.5.30.0080.01515.03
5.5.20.0090.01615.24
5.5.10.0090.02414.99
5.5.00.0100.01215.04
5.4.450.0040.01814.13
5.4.440.0060.01514.09
5.4.430.0050.01614.06
5.4.420.0060.01514.06
5.4.410.0060.01814.03
5.4.400.0030.01614.10
5.4.390.0050.02214.02
5.4.380.0050.01614.02
5.4.370.0050.01414.03
5.4.360.0060.02814.02
5.4.350.0070.01314.05
5.4.340.0080.01513.98
5.4.330.0090.00812.24
5.4.320.0070.01713.94
5.4.310.0050.01614.05
5.4.300.0050.01513.99
5.4.290.0050.02313.95
5.4.280.0090.01713.94
5.4.270.0050.02113.98
5.4.260.0060.01414.04
5.4.250.0060.01513.99
5.4.240.0070.01513.98
5.4.230.0090.01414.08
5.4.220.0060.01613.97
5.4.210.0170.01214.00
5.4.200.0100.01113.95
5.4.190.0050.01713.95
5.4.180.0080.01514.06
5.4.170.0070.01313.98
5.4.160.0060.02313.87
5.4.150.0070.01513.95
5.4.140.0050.01613.37
5.4.130.0060.01913.48
5.4.120.0060.01413.39
5.4.110.0060.02013.32
5.4.100.0030.01913.40
5.4.90.0070.01513.44
5.4.80.0100.00913.46
5.4.70.0050.01913.49
5.4.60.0060.01513.51
5.4.50.0100.01513.46
5.4.40.0050.01613.37
5.4.30.0090.01513.30
5.4.20.0040.01613.40
5.4.10.0070.01513.31
5.4.00.0080.01213.19
5.3.290.0090.01813.95
5.3.280.0070.02113.83
5.3.270.0100.01813.87
5.3.260.0090.02513.92
5.3.250.0090.01813.88
5.3.240.0050.02713.87
5.3.230.0090.01913.87
5.3.220.0070.02713.88
5.3.210.0080.02113.84
5.3.200.0070.01813.87
5.3.190.0090.01513.89
5.3.180.0060.02313.89
5.3.170.0080.01613.88
5.3.160.0070.01913.92
5.3.150.0040.02113.89
5.3.140.0060.01913.96
5.3.130.0060.02413.85
5.3.120.0080.01713.92
5.3.110.0120.01213.87
5.3.100.0070.01613.87
5.3.90.0060.01613.86
5.3.80.0090.02513.83
5.3.70.0040.02013.84
5.3.60.0050.01813.85
5.3.50.0100.01413.90
5.3.40.0060.01913.90
5.3.30.0080.01613.92
5.3.20.0100.01513.86
5.3.10.0060.01813.88
5.3.00.0130.01713.79
5.2.170.0090.01213.47
5.2.160.0030.01713.51
5.2.150.0060.01413.45
5.2.140.0040.01613.42
5.2.130.0040.01513.52
5.2.120.0070.01413.43
5.2.110.0070.01213.52
5.2.100.0060.01513.43
5.2.90.0050.01613.51
5.2.80.0050.01413.45
5.2.70.0040.01413.41
5.2.60.0040.01613.42
5.2.50.0090.01713.42
5.2.40.0070.02513.46
5.2.30.0070.01413.50
5.2.20.0080.02213.36
5.2.10.0050.02613.37
5.2.00.0100.01213.31
5.1.60.0060.01213.15
5.1.50.0080.02213.15
5.1.40.0040.01313.15
5.1.30.0050.01413.19
5.1.20.0030.01513.11
5.1.10.0060.01013.14
5.1.00.0080.01013.04
5.0.50.0040.01012.90
5.0.40.0030.01012.89
5.0.30.0020.01412.89
5.0.20.0020.01512.89
5.0.10.0030.00812.89
5.0.00.0030.01412.89
4.4.90.0040.00612.89
4.4.80.0020.01112.89
4.4.70.0050.01512.89
4.4.60.0010.01312.89
4.4.50.0050.00812.89
4.4.40.0020.01312.89
4.4.30.0020.00812.89
4.4.20.0050.00912.89
4.4.10.0030.00712.89
4.4.00.0020.01212.89
4.3.110.0010.00812.89
4.3.100.0030.00612.89
4.3.90.0000.01512.89
4.3.80.0000.01312.89
4.3.70.0010.00812.89
4.3.60.0020.00712.89
4.3.50.0010.00812.89
4.3.40.0020.01112.89
4.3.30.0020.00712.89
4.3.20.0030.01112.89
4.3.10.0020.01012.89
4.3.00.0000.01012.89

preferences:
51.63 ms | 400 KiB | 5 Q