3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decartProduct($one, $two) { $result = []; for($i=0; $i<count($one); $i++) { for($j=0; $j<count($two); $j++) { if(!count(array_intersect((array)$one[$i], (array)$two[$j]))) { $result[]=array_merge((array)$one[$i], (array)$two[$j]); } } } return $result; } function createAssociation() { $args = func_get_args(); if(!count($args)) { return []; } $result = array_shift($args); while($array=array_shift($args)) { $result=decartProduct($result, $array); } return $result; } $i[0] = ['a', 'b', 'c']; $i[1] = ['d', 'e']; $i[2] = ['a', 'b', 'c']; $i[3] = ['d', 'e']; $i[4] = ['f', 'g', 'h']; $result = call_user_func_array('createAssociation', $i); var_dump($result);

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.00718.52
8.3.60.0100.00716.75
8.3.50.0130.00821.99
8.3.40.0030.01418.84
8.3.30.0090.00619.13
8.3.20.0060.00320.16
8.3.10.0060.00321.77
8.3.00.0100.00019.50
8.2.180.0070.01018.02
8.2.170.0160.00622.96
8.2.160.0090.00620.28
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0050.00526.16
8.2.120.0060.00322.25
8.2.110.0100.00022.07
8.2.100.0070.00617.82
8.2.90.0050.00319.34
8.2.80.0030.00617.97
8.2.70.0060.00617.63
8.2.60.0080.00017.93
8.2.50.0080.00018.07
8.2.40.0040.00419.89
8.2.30.0040.00419.96
8.2.20.0040.00417.80
8.2.10.0000.00818.14
8.2.00.0090.00417.67
8.1.280.0140.00725.92
8.1.270.0030.00623.80
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0060.00323.82
8.1.230.0060.00619.00
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0000.00917.25
8.1.190.0030.00517.35
8.1.180.0100.00018.10
8.1.170.0030.00618.48
8.1.160.0000.00821.94
8.1.150.0060.00618.57
8.1.140.0050.00317.46
8.1.130.0080.00017.82
8.1.120.0040.00417.47
8.1.110.0030.00617.47
8.1.100.0000.00817.54
8.1.90.0060.00317.38
8.1.80.0030.00617.40
8.1.70.0020.00517.47
8.1.60.0060.00317.48
8.1.50.0000.00817.52
8.1.40.0040.00417.52
8.1.30.0040.00417.47
8.1.20.0000.00817.71
8.1.10.0000.00817.59
8.1.00.0080.00017.54
8.0.300.0040.00420.76
8.0.290.0040.00417.18
8.0.280.0000.00718.42
8.0.270.0030.00517.19
8.0.260.0030.00317.19
8.0.250.0050.00216.96
8.0.240.0030.00316.84
8.0.230.0000.00816.96
8.0.220.0040.00416.83
8.0.210.0060.00316.91
8.0.200.0050.00217.01
8.0.190.0060.00316.86
8.0.180.0040.00416.87
8.0.170.0050.00416.95
8.0.160.0040.00416.96
8.0.150.0040.00416.74
8.0.140.0000.00816.86
8.0.130.0000.00713.30
8.0.120.0030.00616.86
8.0.110.0030.00616.86
8.0.100.0040.00416.87
8.0.90.0030.00616.89
8.0.80.0070.01116.97
8.0.70.0000.00916.90
8.0.60.0030.00616.96
8.0.50.0060.00316.84
8.0.30.0090.01717.14
8.0.20.0150.00917.40
8.0.10.0000.00817.07
8.0.00.0090.01116.88
7.4.330.0050.00015.05
7.4.320.0040.00416.66
7.4.300.0030.00316.57
7.4.290.0030.00616.50
7.4.280.0040.00716.58
7.4.270.0040.00416.60
7.4.260.0000.00716.52
7.4.250.0050.00316.62
7.4.240.0040.00416.47
7.4.230.0000.00816.43
7.4.220.0110.01116.66
7.4.210.0050.01316.63
7.4.200.0050.00216.73
7.4.190.0000.00816.47
7.4.160.0030.01516.76
7.4.150.0130.01117.40
7.4.140.0160.00817.86
7.4.130.0110.01016.53
7.4.120.0090.01416.52
7.4.110.0140.00716.64
7.4.100.0130.01316.61
7.4.90.0110.01116.56
7.4.80.0080.01219.39
7.4.70.0100.01116.38
7.4.60.0150.00616.54
7.4.50.0000.01016.52
7.4.40.0030.01222.77
7.4.30.0130.00816.40
7.4.00.0060.01315.17
7.3.330.0000.00613.36
7.3.320.0000.00613.14
7.3.310.0040.00416.39
7.3.300.0040.00416.45
7.3.290.0030.02016.30
7.3.280.0100.01116.36
7.3.270.0120.01217.40
7.3.260.0180.01216.21
7.3.250.0180.00716.51
7.3.240.0080.01116.44
7.3.230.0090.01216.43
7.3.210.0150.00716.58
7.3.200.0060.01719.39
7.3.190.0140.01516.64
7.3.180.0160.00416.71
7.3.170.0120.00916.70
7.3.160.0080.01116.73
7.3.120.0040.01515.07
7.3.10.0030.01016.54
7.3.00.0090.00016.34
7.2.330.0110.01216.48
7.2.320.0140.00616.77
7.2.310.0060.01316.89
7.2.300.0100.01716.84
7.2.290.0130.00616.76
7.2.130.0040.00716.93
7.2.120.0040.00817.02
7.2.110.0060.00617.00
7.2.100.0070.00717.13
7.2.90.0080.00816.84
7.2.80.0090.00617.04
7.2.70.0170.00316.84
7.2.60.0130.00317.00
7.2.50.0030.00616.65
7.2.40.0030.00917.04
7.2.30.0030.00917.05
7.2.20.0000.01516.95
7.2.10.0060.00916.97
7.2.00.0000.01418.20
7.1.250.0060.00615.77
7.1.100.0060.01017.88
7.1.70.0040.00417.17
7.1.60.0100.01719.46
7.1.50.0070.00716.97
7.1.00.0070.07322.28
7.0.200.0070.00316.65
7.0.140.0070.07322.07
7.0.60.0170.05019.96
7.0.50.0100.07717.92
7.0.40.0030.08720.18
7.0.30.0270.05320.32
7.0.20.0270.05320.17
7.0.10.0300.06720.20
7.0.00.0130.08720.11
5.6.280.0000.08020.89
5.6.210.0070.08020.60
5.6.200.0070.05718.29
5.6.190.0070.05720.54
5.6.180.0200.06020.61
5.6.170.0370.06720.44
5.6.160.0070.03720.44
5.6.150.0030.07718.29
5.6.140.0130.07018.28
5.6.130.0070.07018.18
5.6.120.0100.08021.02
5.6.110.0070.08021.07
5.6.100.0200.07021.14
5.6.90.0130.07021.02
5.6.80.0100.08020.44
5.6.70.3930.02720.54
5.5.350.0070.07320.45
5.5.340.0030.09017.96
5.5.330.0200.04320.34
5.5.320.0230.04320.22
5.5.310.0200.04320.51
5.5.300.0070.04717.98
5.5.290.0030.06017.98
5.5.280.0030.06720.69
5.5.270.0070.05320.91
5.5.260.0100.07720.65
5.5.250.0070.09020.75
5.5.240.0170.07320.30
5.4.450.0930.07319.39
5.4.440.0730.05319.59
5.4.430.0300.06319.38
5.4.420.0600.07019.16
5.4.410.0800.05319.34
5.4.400.0200.04719.27
5.4.390.0270.06318.86
5.4.380.0170.06318.78
5.4.370.0370.04718.57
5.4.360.0370.05318.80
5.4.350.0330.05318.81
5.4.340.0570.06318.77
5.4.320.0080.03812.55
5.4.310.0110.03912.54
5.4.300.0030.04212.54
5.4.290.0090.03812.52
5.4.280.0080.03712.42
5.4.270.0100.03912.43
5.4.260.0140.03912.43
5.4.250.0140.04412.43
5.4.240.0110.04812.43
5.4.230.0140.04312.42
5.4.220.0090.04812.41
5.4.210.0060.04012.42
5.4.200.0140.06212.42
5.4.190.0170.05512.41
5.4.180.0190.04612.41
5.4.170.0100.04012.42
5.4.160.0140.04912.42
5.4.150.0130.06912.41
5.4.140.0110.04812.10
5.4.130.0190.07212.09
5.4.120.0090.06112.04
5.4.110.0070.05612.04
5.4.100.0110.04912.04
5.4.90.0120.04912.04
5.4.80.0080.04112.04
5.4.70.0110.05312.04
5.4.60.0100.05212.04
5.4.50.0090.05312.04
5.4.40.0090.05312.02
5.4.30.0120.05312.02
5.4.20.0120.05312.02
5.4.10.0120.05212.02
5.4.00.0120.05411.51
5.3.290.0040.04112.80
5.3.280.0070.05212.71
5.3.270.0070.05512.72
5.3.260.0060.05712.72
5.3.250.0050.05412.71
5.3.240.0050.03912.72
5.3.230.0070.03712.71
5.3.220.0050.03912.68
5.3.210.0040.04112.68
5.3.200.0060.03712.68
5.3.190.0080.03612.68
5.3.180.0070.03712.67
5.3.170.0090.05012.67
5.3.160.0140.06012.67
5.3.150.0110.05012.67
5.3.140.0080.04112.66
5.3.130.0020.04612.66
5.3.120.0070.05512.66
5.3.110.0070.04412.65
5.3.100.0070.05212.13
5.3.90.0050.03812.11
5.3.80.0050.03712.09
5.3.70.0040.03812.09
5.3.60.0050.03812.08
5.3.50.0050.03812.02
5.3.40.0050.04112.02
5.3.30.0080.04711.98
5.3.20.0100.04711.76
5.3.10.0070.04311.74
5.3.00.0060.03711.72
5.2.170.0060.0399.21
5.2.160.0060.0439.21
5.2.150.0070.0439.21
5.2.140.0060.0349.21
5.2.130.0060.0429.17
5.2.120.0100.0459.18
5.2.110.0120.0359.18
5.2.100.0050.0349.18
5.2.90.0020.0359.18
5.2.80.0080.0309.17
5.2.70.0050.0319.18
5.2.60.0080.0369.12
5.2.50.0060.0299.09
5.2.40.0050.0299.07
5.2.30.0070.0289.05
5.2.20.0070.0289.04
5.2.10.0070.0278.95
5.2.00.0020.0328.80
5.1.60.0050.0258.08
5.1.50.0050.0258.09
5.1.40.0080.0228.07
5.1.30.0090.0228.42
5.1.20.0040.0278.44
5.1.10.0020.0288.16
5.1.00.0030.0288.16
5.0.50.0050.0196.64
5.0.40.0020.0216.50
5.0.30.0060.0316.31
5.0.20.0030.0216.28
5.0.10.0030.0206.27
5.0.00.0010.0346.25
4.4.90.0030.0154.78
4.4.80.0040.0234.75
4.4.70.0050.0214.76
4.4.60.0070.0154.76
4.4.50.0020.0164.77
4.4.40.0030.0254.70
4.4.30.0010.0174.75
4.4.20.0050.0174.84
4.4.10.0050.0184.85
4.4.00.0030.0264.76
4.3.110.0040.0144.67
4.3.100.0040.0144.67
4.3.90.0030.0144.64
4.3.80.0030.0254.58
4.3.70.0010.0174.63
4.3.60.0070.0114.63
4.3.50.0040.0154.63
4.3.40.0070.0224.54
4.3.30.0030.0173.30
4.3.20.0030.0233.27
4.3.10.0030.0223.24
4.3.00.0100.02010.55

preferences:
45.53 ms | 401 KiB | 5 Q