3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attributes = [ [ 'title' => 'Size', 'Variation' => ['Small', 'Medium', 'Large'] ], [ 'title' => 'Length', 'Variation' => ['Short', 'Regular', 'Long'] ], [ 'title' => 'Color', 'Variation' => ['Black', 'White'] ] ]; function combinate($result, $variations) { $ret = []; foreach( $variations as $v ) { foreach( $result as $r ) { $ret[] = $v . ' ' . $r; } } return $ret; } $ret = $attributes[count($attributes) - 1]['Variation']; for( $i = count($attributes) - 2; $i >= 0; $i--) { $ret = combinate($ret, $attributes[$i]['Variation']); } print_r($ret);

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.5.00.0120.01120.01
8.4.150.0020.00114.05
8.4.140.0120.01217.45
8.4.130.0100.01117.64
8.4.120.0130.00720.50
8.4.110.0090.01120.36
8.4.100.0130.00817.69
8.4.90.0160.00520.74
8.4.80.0060.00318.89
8.4.70.0070.00918.96
8.4.60.0120.00418.86
8.4.50.0080.01117.70
8.4.40.0130.00619.39
8.4.30.0100.01020.46
8.4.20.0030.01219.71
8.4.10.0030.00617.66
8.3.280.0100.01120.26
8.3.270.0140.01216.54
8.3.260.0130.00816.86
8.3.250.0100.00918.94
8.3.240.0110.00916.51
8.3.230.0070.01216.64
8.3.220.0030.00518.79
8.3.210.0130.00518.34
8.3.200.0050.00316.51
8.3.190.0130.00617.13
8.3.180.0060.00216.70
8.3.170.0120.00617.02
8.3.160.0140.00416.82
8.3.150.0120.00616.98
8.3.140.0040.00416.62
8.3.130.0100.00016.83
8.3.120.0140.00718.93
8.3.110.0030.01020.94
8.3.100.0080.00024.06
8.3.90.0090.00026.77
8.3.80.0040.00419.36
8.3.70.0030.01216.50
8.3.60.0130.01018.32
8.3.50.0070.00624.61
8.3.40.0110.00718.83
8.3.30.0110.00318.84
8.3.20.0090.00020.89
8.3.10.0060.00620.12
8.3.00.0050.00320.82
8.2.290.0040.00516.84
8.2.280.0050.00418.51
8.2.270.0060.00916.59
8.2.260.0040.01118.86
8.2.250.0040.00418.36
8.2.240.0060.00317.38
8.2.230.0000.00822.58
8.2.220.0030.00537.54
8.2.210.0080.00026.77
8.2.200.0060.00318.88
8.2.190.0170.00016.58
8.2.180.0170.00318.16
8.2.170.0070.00722.96
8.2.160.0080.00522.11
8.2.150.0070.00024.18
8.2.140.0020.00524.66
8.2.130.0000.00726.16
8.2.120.0040.00426.16
8.2.110.0100.00020.47
8.2.100.0110.00017.72
8.2.90.0000.00817.72
8.2.80.0040.00417.97
8.2.70.0060.00318.16
8.2.60.0050.00518.09
8.2.50.0100.00019.47
8.2.40.0080.00021.13
8.2.30.0000.00719.30
8.2.20.0040.00418.05
8.2.10.0040.00418.82
8.2.00.0000.00719.30
8.1.330.0140.00516.09
8.1.320.0130.00716.22
8.1.310.0030.00516.84
8.1.300.0110.00718.41
8.1.290.0030.00630.84
8.1.280.0120.00325.92
8.1.270.0040.00420.67
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0040.00420.87
8.1.230.0060.00320.98
8.1.220.0000.00820.91
8.1.210.0050.00318.77
8.1.200.0000.00817.35
8.1.190.0080.00017.13
8.1.180.0080.00018.10
8.1.170.0040.00418.56
8.1.160.0080.00020.26
8.1.150.0000.00818.90
8.1.140.0050.00218.78
8.1.130.0000.00720.07
8.1.120.0040.00417.50
8.1.110.0040.00417.42
8.1.100.0000.00817.51
8.1.90.0040.00417.42
8.1.80.0060.00317.50
8.1.70.0000.00717.41
8.1.60.0020.00517.57
8.1.50.0000.00817.45
8.1.40.0000.00817.52
8.1.30.0110.00617.52
8.1.20.0100.00517.64
8.1.10.0070.00717.55
8.1.00.0130.00417.50
8.0.300.0040.00419.77
8.0.290.0000.00716.75
8.0.280.0030.00318.36
8.0.270.0030.00316.76
8.0.260.0030.00320.07
8.0.250.0070.00016.95
8.0.240.0030.00516.85
8.0.230.0000.00716.98
8.0.220.0000.00816.88
8.0.210.0000.00716.96
8.0.200.0070.00016.96
8.0.190.0060.00316.97
8.0.180.0000.00816.93
8.0.170.0030.00616.89
8.0.160.0060.00816.84
8.0.150.0070.00616.79
8.0.140.0070.00616.82
8.0.130.0090.00315.02
8.0.120.0080.00616.82
8.0.110.0100.00316.83
8.0.100.0110.00316.77
8.0.90.0120.00216.90
8.0.80.0120.00616.83
8.0.70.0100.00416.82
8.0.60.0080.00616.85
8.0.50.0080.00616.79
8.0.30.0180.00316.95
8.0.20.0120.00816.91
8.0.10.0070.00516.96
8.0.00.0110.01016.89
7.4.330.0050.00015.55
7.4.320.0060.00016.53
7.4.300.0000.00616.49
7.4.290.0040.00416.50
7.4.280.0090.00716.43
7.4.270.0110.00316.52
7.4.260.0090.00414.85
7.4.250.0070.00316.46
7.4.240.0020.00616.56
7.4.230.0070.00516.51
7.4.220.0040.00616.42
7.4.210.0080.00616.49
7.4.200.0030.01016.46
7.4.190.0080.00716.43
7.4.180.0090.00616.46
7.4.160.0140.00016.64
7.4.150.0120.00816.43
7.4.140.0120.00416.37
7.4.130.0080.00616.41
7.4.120.0100.00716.51
7.4.110.0070.00716.32
7.4.100.0120.01216.37
7.4.90.0100.00716.40
7.4.80.0100.00817.94
7.4.70.0130.00416.54
7.4.60.0090.00916.53
7.4.50.0100.00716.41
7.4.40.0110.00616.47
7.4.30.0110.00816.56
7.4.20.0110.00716.46
7.4.10.0130.00716.43
7.4.00.0080.00915.71
7.3.330.0070.00616.36
7.3.320.0120.00014.74
7.3.310.0070.00616.32
7.3.300.0070.00616.26
7.3.290.0120.00116.32
7.3.280.0110.00716.41
7.3.270.0090.00916.38
7.3.260.0160.00216.57
7.3.250.0110.00716.21
7.3.240.0090.00916.35
7.3.230.0130.00516.25
7.3.220.0140.00516.22
7.3.210.0120.00516.29
7.3.200.0110.00616.42
7.3.190.0090.00916.42
7.3.180.0150.00516.45
7.3.170.0080.01016.38
7.3.160.0090.00816.33
7.3.150.0150.00416.13
7.3.140.0140.00516.23
7.3.130.0130.00516.30
7.3.120.0110.00815.50
7.3.110.0090.01015.49
7.3.100.0120.00815.37
7.3.90.0150.00315.56
7.3.80.0130.00515.28
7.3.70.0100.00915.66
7.3.60.0120.00715.52
7.3.50.0110.00715.53
7.3.40.0130.00515.66
7.3.30.0090.00915.69
7.3.20.0070.01016.47
7.3.10.0120.01016.54
7.3.00.0170.00516.56
7.2.340.0140.00416.44
7.2.330.0130.00716.47
7.2.320.0100.00816.61
7.2.310.0110.00716.41
7.2.300.0120.00716.41
7.2.290.0100.00816.45
7.2.280.0090.00916.45
7.2.270.0120.00616.48
7.2.260.0150.00416.25
7.2.250.0090.00916.32
7.2.240.0130.00715.73
7.2.230.0090.01115.70
7.2.220.0120.00715.70
7.2.210.0110.00715.54
7.2.200.0160.00515.80
7.2.190.0070.01015.78
7.2.180.0060.01215.81
7.2.170.0120.00615.72
7.2.160.0110.00815.87
7.2.150.0090.01016.67
7.2.140.0130.00816.88
7.2.130.0160.00816.88
7.2.120.0110.01216.71
7.2.110.0170.01016.83
7.2.100.0130.00716.83
7.2.90.0140.00616.62
7.2.80.0130.00916.79
7.2.70.0130.00816.81
7.2.60.0070.01316.83
7.2.50.0140.00816.87
7.2.40.0110.01016.72
7.2.30.0120.01116.81
7.2.20.0160.00516.88
7.2.10.0110.01116.78
7.2.00.0130.00816.60
7.1.330.0100.01015.66
7.1.320.0140.00715.77
7.1.310.0130.00815.60
7.1.300.0160.00315.74
7.1.290.0110.00615.58
7.1.280.0140.00315.69
7.1.270.0140.00315.49
7.1.260.0120.00715.55
7.1.250.0070.01315.50
7.1.240.0120.00817.18
7.1.230.0080.01217.23
7.1.220.0120.00817.24
7.1.210.0190.00017.33
7.1.200.0170.00317.22
7.1.190.0160.00317.20
7.1.180.0100.01017.22
7.1.170.0130.00717.37
7.1.160.0180.00417.16
7.1.150.0180.00317.08
7.1.140.0140.00517.17
7.1.130.0190.00317.39
7.1.120.0140.00717.36
7.1.110.0170.00217.30
7.1.100.0060.01217.31
7.1.90.0150.00517.31
7.1.80.0120.00817.24
7.1.70.0150.00417.05
7.1.60.0200.00017.23
7.1.50.0160.00417.36
7.1.40.0200.00017.25
7.1.30.0180.00317.37
7.1.20.0150.00517.41
7.1.10.0140.00917.33
7.1.00.0180.00317.30

preferences:
37.5 ms | 403 KiB | 5 Q