3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ ['alteration1', 'alteration4',], ['alteration2','alteration3'], ['alteration2','alteration3'], [] ]; $combinations = [[]]; foreach($data as $index => $current_data){ $current_data = array_unique($current_data); if(empty($current_data)) continue; $temp_combinations = []; foreach($current_data as $value){ foreach($combinations as $each_combination){ $temp_combinations[] = array_merge($each_combination,[$value]); } } $combinations = $temp_combinations; } $set = []; $unique_combinations = []; foreach($combinations as $each_combination){ natsort($each_combination); $serialized_form = implode(",",$each_combination); if(isset($set[$serialized_form])) continue; if(empty($each_combination)) continue; $unique_combinations[] = $each_combination; $set[$serialized_form] = true; } print_r($unique_combinations);

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.70.0100.01018.43
8.3.60.0070.00716.63
8.3.50.0080.00820.09
8.3.40.0080.00818.67
8.3.30.0070.00718.56
8.3.20.0080.00021.68
8.3.10.0040.00421.71
8.3.00.0040.00422.39
8.2.180.0130.00918.41
8.2.170.0100.00722.96
8.2.160.0100.00320.39
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0060.00320.63
8.2.110.0000.01022.21
8.2.100.0080.00317.77
8.2.90.0040.00419.32
8.2.80.0050.00317.97
8.2.70.0060.00317.63
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0040.00419.88
8.2.30.0000.00718.26
8.2.20.0030.00618.20
8.2.10.0000.00718.85
8.2.00.0030.00319.20
8.1.280.0040.01125.92
8.1.270.0040.00420.43
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00320.92
8.1.230.0070.00317.89
8.1.220.0000.00817.79
8.1.210.0050.00318.77
8.1.200.0040.00417.23
8.1.190.0040.00417.35
8.1.180.0090.00018.10
8.1.170.0000.00918.52
8.1.160.0040.00418.96
8.1.150.0040.00418.89
8.1.140.0040.00418.89
8.1.130.0000.00719.23
8.1.120.0000.00717.47
8.1.110.0000.00717.46
8.1.100.0040.00417.52
8.1.90.0000.00717.38
8.1.80.0000.00817.50
8.1.70.0040.00417.52
8.1.60.0040.00417.57
8.1.50.0030.00517.51
8.1.40.0070.00317.49
8.1.30.0080.00017.68
8.1.20.0030.00617.55
8.1.10.0070.00017.47
8.1.00.0000.00817.41
8.0.300.0050.00318.77
8.0.290.0040.00416.75
8.0.280.0030.00318.50
8.0.270.0030.00317.27
8.0.260.0030.00316.81
8.0.250.0030.00616.89
8.0.240.0000.00817.01
8.0.230.0030.00316.96
8.0.220.0070.00016.96
8.0.210.0030.00316.95
8.0.200.0040.00416.96
8.0.190.0030.00416.95
8.0.180.0000.00716.96
8.0.170.0000.00816.96
8.0.160.0000.00816.96
8.0.150.0040.00416.81
8.0.140.0070.00016.86
8.0.130.0000.00613.32
8.0.120.0040.00416.80
8.0.110.0030.00716.83
8.0.100.0040.00416.79
8.0.90.0080.00016.70
8.0.80.0070.00716.94
8.0.70.0040.00416.77
8.0.60.0000.00817.01
8.0.50.0000.00716.78
8.0.30.0030.01417.05
8.0.20.0190.00017.20
8.0.10.0040.00416.91
8.0.00.0100.00716.68
7.4.330.0020.00215.55
7.4.320.0020.00516.53
7.4.300.0000.00716.61
7.4.290.0080.00016.50
7.4.280.0000.00816.36
7.4.270.0040.00416.65
7.4.260.0000.00613.16
7.4.250.0000.00616.57
7.4.240.0030.00516.51
7.4.230.0030.00316.39
7.4.220.0030.00316.55
7.4.210.0080.00816.54
7.4.200.0030.00316.54
7.4.140.0070.01017.86
7.4.130.0060.01616.60
7.4.120.0110.00716.66
7.4.110.0110.00516.56
7.4.100.0100.01016.62
7.4.90.0070.01016.46
7.4.80.0100.01719.39
7.4.70.0070.01016.41
7.4.60.0140.00516.43
7.4.50.0000.01616.53
7.4.40.0160.00316.54
7.4.00.0080.00814.84
7.3.330.0080.00016.40
7.3.320.0000.00513.20
7.3.310.0050.00216.18
7.3.300.0030.00316.32
7.3.290.0040.00416.32
7.3.260.0090.00916.43
7.3.240.0060.01116.39
7.3.230.0100.01016.57
7.3.210.0070.01016.59
7.3.200.0080.00816.27
7.3.190.0060.01016.39
7.3.180.0080.00816.46
7.3.170.0060.01016.35
7.3.160.0070.01416.25
7.3.120.0090.00914.88
7.3.110.0080.00714.71
7.3.100.0060.00914.78
7.3.90.0060.00814.84
7.3.80.0080.00814.82
7.3.70.0070.01014.80
7.3.60.0070.00714.80
7.3.50.0070.00614.74
7.3.40.0090.00514.69
7.3.30.0060.00414.80
7.3.20.0060.00816.12
7.3.10.0110.00416.20
7.3.00.0050.01016.11
7.2.330.0100.01316.76
7.2.320.0090.00916.77
7.2.310.0120.00616.53
7.2.300.0040.01416.37
7.2.290.0130.00316.66
7.2.250.0040.01115.12
7.2.240.0090.00714.95
7.2.230.0070.00915.14
7.2.220.0040.01015.01
7.2.210.0070.00815.10
7.2.200.0030.01515.08
7.2.190.0100.00614.89
7.2.180.0040.00915.02
7.2.170.0070.00915.07
7.2.160.0080.00514.88
7.2.150.0060.00716.22
7.2.140.0090.00716.33
7.2.130.0040.01116.23
7.2.120.0060.00816.22
7.2.110.0040.01015.99
7.2.100.0060.01016.41
7.2.90.0090.00716.22
7.2.80.0090.00616.14
7.2.70.0100.00616.36
7.2.60.0060.00916.29
7.2.50.0080.00616.28
7.2.40.0110.00416.30
7.2.30.0070.00716.28
7.2.20.0050.00916.27
7.2.10.0080.00716.22
7.2.00.0100.00516.34
7.1.330.0070.00915.31
7.1.320.0070.00815.41
7.1.310.0080.00615.35
7.1.300.0060.00915.28
7.1.290.0070.00715.32
7.1.280.0020.01215.30
7.1.270.0080.00415.35
7.1.260.0080.00615.32
7.1.250.0080.00715.19

preferences:
61.68 ms | 401 KiB | 5 Q