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); $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.60.0130.00316.75
8.3.50.0070.01019.89
8.3.40.0040.01118.85
8.3.30.0060.00918.84
8.3.20.0040.00421.92
8.3.10.0040.00421.75
8.3.00.0040.00422.52
8.2.180.0040.01118.16
8.2.170.0090.00622.96
8.2.160.0060.00920.39
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0100.00326.16
8.2.110.0030.00722.25
8.2.100.0040.00817.72
8.2.90.0050.00322.32
8.2.80.0090.00017.97
8.2.70.0000.00817.91
8.2.60.0070.00018.22
8.2.50.0030.00518.10
8.2.40.0000.00819.50
8.2.30.0040.00419.23
8.2.20.0030.00718.36
8.2.10.0000.00719.00
8.2.00.0000.00819.42
8.1.280.0070.01425.92
8.1.270.0040.00420.52
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0030.00622.59
8.1.230.0070.00320.88
8.1.220.0040.00417.74
8.1.210.0060.00318.96
8.1.200.0030.00517.23
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0050.00320.78
8.1.160.0000.00719.02
8.1.150.0050.00218.94
8.1.140.0050.00318.82
8.1.130.0030.00320.06
8.1.120.0040.00417.43
8.1.110.0050.00217.43
8.1.100.0040.00417.43
8.1.90.0040.00417.44
8.1.80.0050.00217.48
8.1.70.0030.00317.38
8.1.60.0060.00317.49
8.1.50.0000.01017.54
8.1.40.0040.00417.54
8.1.30.0040.00417.62
8.1.20.0030.00617.66
8.1.10.0070.00017.42
8.1.00.0040.00417.35
8.0.300.0030.00519.96
8.0.290.0040.00416.75
8.0.280.0040.00418.37
8.0.270.0000.00717.20
8.0.260.0030.00320.00
8.0.250.0080.00316.99
8.0.240.0000.00817.02
8.0.230.0040.00416.95
8.0.220.0070.00016.92
8.0.210.0050.00516.91
8.0.200.0030.00316.97
8.0.190.0050.00316.93
8.0.180.0000.00716.98
8.0.170.0040.00416.80
8.0.160.0040.00416.81
8.0.150.0000.00816.84
8.0.140.0000.00816.74
8.0.130.0000.00513.38
8.0.120.0000.00716.79
8.0.110.0000.00716.86
8.0.100.0040.00416.86
8.0.90.0030.00516.76
8.0.80.0030.01216.91
8.0.70.0040.00416.88
8.0.60.0000.00716.78
8.0.50.0060.00316.78
8.0.30.0110.00617.08
8.0.20.0120.00816.88
8.0.10.0050.00216.91
8.0.00.0150.00616.70
7.4.330.0020.00215.55
7.4.320.0000.00616.61
7.4.300.0030.00316.37
7.4.290.0030.00416.51
7.4.280.0060.00316.55
7.4.270.0040.00416.49
7.4.260.0050.00013.27
7.4.250.0070.00016.46
7.4.240.0020.00616.56
7.4.230.0040.00416.39
7.4.220.0050.00216.61
7.4.210.0090.00716.65
7.4.200.0030.00316.70
7.4.140.0060.01217.86
7.4.130.0060.01216.50
7.4.120.0100.01316.73
7.4.110.0070.01016.55
7.4.100.0040.01516.44
7.4.90.0030.01416.50
7.4.80.0030.01419.39
7.4.70.0100.01016.49
7.4.60.0110.00816.43
7.4.50.0060.00616.57
7.4.40.0110.00616.61
7.4.00.0070.01015.03
7.3.330.0030.00616.37
7.3.320.0000.00513.30
7.3.310.0070.00016.39
7.3.300.0030.00316.22
7.3.290.0000.00616.32
7.3.260.0110.01016.42
7.3.240.0050.01116.45
7.3.230.0090.00916.53
7.3.210.0100.00616.32
7.3.200.0070.00916.65
7.3.190.0060.01116.37
7.3.180.0060.00916.43
7.3.170.0120.00416.59
7.3.160.0110.01116.64
7.3.120.0070.01214.81
7.3.110.0090.00614.74
7.3.100.0040.01114.83
7.3.90.0090.00614.92
7.3.80.0060.00714.95
7.3.70.0020.00914.71
7.3.60.0030.01014.71
7.3.50.0040.01114.72
7.3.40.0090.00814.68
7.3.30.0040.01214.78
7.3.20.0090.00416.52
7.3.10.0060.00816.67
7.3.00.0090.00516.69
7.2.330.0100.00716.64
7.2.320.0120.00416.54
7.2.310.0030.01916.70
7.2.300.0120.00916.77
7.2.290.0060.01116.54
7.2.250.0060.01315.07
7.2.240.0070.00915.02
7.2.230.0110.00615.02
7.2.220.0060.00815.14
7.2.210.0030.01415.04
7.2.200.0060.00815.08
7.2.190.0070.00614.95
7.2.180.0070.01015.11
7.2.170.0030.01415.05
7.2.160.0060.00815.09
7.2.150.0100.00616.83
7.2.140.0080.00816.74
7.2.130.0050.01016.88
7.2.120.0070.01216.75
7.2.110.0070.00916.75
7.2.100.0070.00716.95
7.2.90.0060.00616.79
7.2.80.0050.00916.83
7.2.70.0070.00516.97
7.2.60.0120.00316.96
7.2.50.0030.01016.81
7.2.40.0060.01016.97
7.2.30.0050.01017.01
7.2.20.0070.01016.91
7.2.10.0050.00916.78
7.2.00.0050.00816.87
7.1.330.0050.01115.89
7.1.320.0060.00715.81
7.1.310.0060.00715.75
7.1.300.0050.00715.73
7.1.290.0060.00815.63
7.1.280.0040.01215.75
7.1.270.0050.00815.78
7.1.260.0050.00815.83
7.1.250.0060.00815.73
7.1.240.0040.00816.04
7.1.230.0030.00515.92
7.1.220.0070.00715.85
7.1.210.0030.01415.86
7.1.200.0100.00315.80
7.1.190.0000.00915.77
7.1.180.0030.00715.70
7.1.170.0040.00715.80
7.1.160.0070.01115.69
7.1.150.0060.01015.91
7.1.140.0060.01215.46
7.1.130.0040.00415.60
7.1.120.0100.00315.63
7.1.110.0060.00615.79
7.1.100.0060.00315.63
7.1.90.0030.00915.28
7.1.80.0110.00315.64
7.1.70.0040.01115.86
7.1.60.0060.00915.77
7.1.50.0000.01515.61
7.1.40.0030.01015.52
7.1.30.0040.00815.83
7.1.20.0000.00915.69
7.1.10.0040.00415.68
7.1.00.0030.00715.50

preferences:
35.89 ms | 404 KiB | 6 Q