3v4l.org

run code in 300+ PHP versions simultaneously
<?php $set1 = ['A', 'B', 'C']; $set2 = [1, 2, 3]; function perms( $set1, $set2, $i) { $perms = array(); if( $i == size( $set1) - 1) { return array(); } foreach( $set1 as $n1) { foreach( $set2 as $n2) { $perms[] = $n1 . $n2; } } $i++; for( $j = 0; $j < $i; $j++) { $set1[] = array_shift( $set1); $set2[] = array_shift( $set2); } return array_merge( $perms, perms( $set1, $set2)); } var_dump( perms( $set1, $set2, 0));

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.0100.00718.55
8.3.50.0250.00421.20
8.3.40.0070.00718.87
8.3.30.0000.01420.39
8.3.20.0080.00020.56
8.3.10.0040.00421.08
8.3.00.0070.00023.71
8.2.180.0110.00717.00
8.2.170.0110.00422.96
8.2.160.0110.00720.39
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00421.00
8.2.110.0060.00319.33
8.2.100.0090.00317.90
8.2.90.0050.00219.13
8.2.80.0040.00417.97
8.2.70.0000.00817.50
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0050.00518.22
8.2.30.0060.00319.34
8.2.20.0000.00717.80
8.2.10.0040.00417.68
8.2.00.0000.00717.79
8.1.270.0070.00023.99
8.1.260.0040.00426.35
8.1.250.0020.00528.09
8.1.240.0090.00022.34
8.1.230.0100.00020.89
8.1.220.0000.00818.77
8.1.210.0030.00618.77
8.1.200.0030.00617.35
8.1.190.0070.00017.41
8.1.180.0000.00818.10
8.1.170.0040.00418.53
8.1.160.0040.00418.76
8.1.150.0040.00418.52
8.1.140.0070.00017.32
8.1.130.0030.00317.36
8.1.120.0040.00417.47
8.1.110.0080.00017.24
8.1.100.0080.00017.48
8.1.90.0000.00717.46
8.1.80.0040.00417.46
8.1.70.0070.00017.37
8.1.60.0090.00017.49
8.1.50.0030.00617.54
8.1.40.0060.00317.56
8.1.30.0030.00517.71
8.1.20.0000.00817.70
8.1.10.0000.00817.62
8.1.00.0050.00217.56
8.0.300.0040.00419.79
8.0.290.0000.00717.03
8.0.280.0070.00018.29
8.0.270.0040.00417.22
8.0.260.0000.00716.86
8.0.250.0050.00317.03
8.0.240.0040.00416.98
8.0.230.0030.00316.87
8.0.220.0000.00716.88
8.0.210.0080.00316.88
8.0.200.0070.00017.04
8.0.190.0040.00416.84
8.0.180.0070.00016.92
8.0.170.0000.00716.91
8.0.160.0070.00016.93
8.0.150.0000.00716.81
8.0.140.0120.00016.93
8.0.130.0000.00613.34
8.0.120.0000.00816.78
8.0.110.0000.00716.95
8.0.100.0000.00716.74
8.0.90.0000.00816.77
8.0.80.0060.00916.89
8.0.70.0080.00016.94
8.0.60.0070.00016.91
8.0.50.0000.00716.73
8.0.30.0140.00617.14
8.0.20.0110.00817.40
8.0.10.0030.00316.86
8.0.00.0080.01116.86
7.4.330.0040.00015.04
7.4.320.0060.00016.44
7.4.300.0060.00016.61
7.4.290.0030.00316.60
7.4.280.0000.00716.49
7.4.270.0000.00716.46
7.4.260.0000.00613.23
7.4.250.0070.00016.62
7.4.240.0000.00716.65
7.4.230.0000.00716.62
7.4.220.0030.01316.63
7.4.210.0080.00816.60
7.4.200.0000.00716.58
7.4.190.0030.00316.70
7.4.160.0030.01316.52
7.4.150.0040.01317.40
7.4.140.0090.00917.86
7.4.130.0120.00516.47
7.4.120.0100.00816.41
7.4.110.0110.00716.61
7.4.100.0070.01116.41
7.4.90.0090.00916.59
7.4.80.0100.00719.39
7.4.70.0130.00316.33
7.4.60.0140.00716.71
7.4.50.0080.00016.26
7.4.40.0030.01222.77
7.4.30.0130.00316.67
7.4.00.0060.00615.20
7.3.330.0020.00213.13
7.3.320.0000.00513.10
7.3.310.0030.00316.33
7.3.300.0040.00416.35
7.3.290.0030.01016.21
7.3.280.0100.00716.32
7.3.270.0060.01017.40
7.3.260.0120.00418.24
7.3.250.0100.00916.49
7.3.240.0140.00816.55
7.3.230.0110.00616.39
7.3.210.0130.00316.32
7.3.200.0120.01219.39
7.3.190.0070.01016.39
7.3.180.0090.00616.18
7.3.170.0050.01116.29
7.3.160.0130.01016.34
7.3.120.0100.00614.60
7.3.10.0080.00516.42
7.3.00.0120.00016.80
7.2.330.0140.00616.57
7.2.320.0100.00716.60
7.2.310.0070.01016.50
7.2.300.0100.01316.38
7.2.290.0100.00616.66
7.2.130.0060.01216.72
7.2.120.0090.00616.79
7.2.110.0030.00716.83
7.2.100.0060.00916.73
7.2.90.0030.01216.69
7.2.80.0030.01016.59
7.2.70.0000.01516.91
7.2.60.0060.00716.62
7.2.50.0030.01016.73
7.2.40.0070.01016.81
7.2.30.0030.01216.95
7.2.20.0070.00716.51
7.2.10.0100.00716.84
7.2.00.0070.00717.74
7.1.250.0110.00415.75
7.1.200.0040.01115.49
7.1.100.0060.00618.01
7.1.70.0030.00617.07
7.1.60.0070.01419.17
7.1.50.0040.01516.80
7.1.00.0070.03722.32
7.0.200.0030.00716.45
7.0.140.0000.07721.97
7.0.110.0030.04720.12
7.0.100.0030.07320.02
7.0.90.0070.07319.97
7.0.80.0030.08320.08
7.0.70.0070.05019.88
7.0.60.0000.04320.05
7.0.50.0100.03720.00
7.0.40.0000.06719.73
7.0.30.0070.06319.66
7.0.20.0070.05319.86
7.0.10.0070.07719.73
7.0.00.0000.04719.84
5.6.280.0070.07021.07
5.6.260.0000.04720.50
5.6.250.0030.04020.71
5.6.240.0070.06720.70
5.6.230.0100.06720.57
5.6.220.0000.05020.54
5.6.210.0000.04720.63
5.6.200.0030.06320.66
5.6.190.0070.06020.86
5.6.180.0070.03320.65
5.6.170.0000.05320.56
5.6.160.0100.05720.58
5.6.150.0030.05020.56
5.6.140.0030.05720.57
5.6.130.0070.04020.70
5.6.120.0000.04320.64
5.6.110.0000.07320.58
5.6.100.0000.04320.45
5.6.90.0030.04320.69
5.6.80.0030.07719.93
5.6.70.0130.07720.07
5.6.60.0100.07019.98
5.6.50.0100.07319.93
5.6.40.0070.03320.22
5.6.30.0100.08019.97
5.6.20.0070.07319.91
5.6.10.0030.05719.91
5.6.00.0000.06019.96
5.5.380.0030.05317.50
5.5.370.0070.08017.70
5.5.360.0100.05317.62
5.5.350.0000.04017.66
5.5.340.0000.04318.07
5.5.330.0000.03717.98
5.5.320.0070.04317.91
5.5.310.0000.05018.11
5.5.300.0030.05718.09
5.5.290.0070.05018.09
5.5.280.0070.04018.09
5.5.270.0070.04317.92
5.5.260.0030.07718.09
5.5.250.0070.07717.74
5.5.240.0030.06717.48
5.5.230.0030.06017.63
5.5.220.0100.05717.33
5.5.210.0030.07017.29
5.5.200.0070.03017.32
5.5.190.0000.08017.54
5.5.180.0000.04317.28
5.5.160.0000.03717.29
5.5.150.0170.04717.45
5.5.140.0000.05317.26
5.5.130.0100.02717.45
5.5.120.0070.04717.45
5.5.110.0070.07317.43
5.5.100.0100.07017.36
5.5.90.0100.08017.38
5.5.80.0100.03317.36
5.5.70.0030.04717.15
5.5.60.0070.06717.35
5.5.50.0130.06717.36
5.5.40.0070.07017.17
5.5.30.0030.08017.34
5.5.20.0030.07717.31
5.5.10.0100.03717.31
5.5.00.0230.03017.30
5.4.450.0070.04019.51
5.4.440.0070.05019.31
5.4.430.0070.07719.55
5.4.420.0070.03719.62
5.4.410.0100.03319.23
5.4.400.0030.08019.01
5.4.390.0100.06319.00
5.4.380.0100.06319.08
5.4.370.0000.05019.16
5.4.360.0030.07719.00
5.4.350.0030.05018.98
5.4.340.0070.03319.30
5.4.320.0070.07319.13
5.4.310.0070.07318.98
5.4.300.0030.07018.98
5.4.290.0030.03319.02
5.4.280.0030.08019.02
5.4.270.0070.08019.23
5.4.260.0030.08018.96
5.4.250.0030.07319.13
5.4.240.0030.06718.99
5.4.230.0070.03719.15
5.4.220.0100.07018.99
5.4.210.0100.04319.08
5.4.200.0000.04719.29
5.4.190.0030.04019.27
5.4.180.0030.04018.96
5.4.170.0070.06319.11
5.4.160.0130.03719.17
5.4.150.0030.06319.06
5.4.140.0100.03316.54
5.4.130.0100.06016.49
5.4.120.0100.06716.50
5.4.110.0070.07716.22
5.4.100.0070.07016.40
5.4.90.0100.07016.66
5.4.80.0030.05716.63
5.4.70.0070.07016.66
5.4.60.0030.06316.52
5.4.50.0000.06716.56
5.4.40.0070.05716.49
5.4.30.0030.05016.53
5.4.20.0100.06716.42
5.4.10.0000.04716.52
5.4.00.0030.07315.73
5.3.290.0100.07314.69
5.3.280.0030.08714.52
5.3.270.0070.04314.61
5.3.260.0100.06014.56
5.3.250.0070.04014.39
5.3.240.0030.03714.62
5.3.230.0030.07014.43
5.3.220.0030.06014.45
5.3.210.0070.07714.47
5.3.200.0100.06714.45
5.3.190.0070.07014.64
5.3.180.0030.05014.64
5.3.170.0030.04314.41
5.3.160.0000.06014.58
5.3.150.0000.07714.35
5.3.140.0130.06314.65
5.3.130.0100.07314.49
5.3.120.0200.06314.38
5.3.110.0100.07014.34
5.3.100.0100.07314.04
5.3.90.0070.03713.93
5.3.80.0030.07013.95
5.3.70.0170.03313.94
5.3.60.0070.07713.93
5.3.50.0070.07313.79
5.3.40.0100.05314.00
5.3.30.0100.07314.00
5.3.20.0130.06313.54
5.3.10.0070.05013.50
5.3.00.0030.07713.42
5.2.170.0030.03711.90
5.2.160.0030.06011.90
5.2.150.0030.04011.90
5.2.140.0100.04711.90
5.2.130.0100.05011.90
5.2.120.0070.05711.90
5.2.110.0070.05311.90
5.2.100.0100.03311.90
5.2.90.0000.04711.90
5.2.80.0000.03011.90
5.2.70.0000.03311.90
5.2.60.0000.06311.90
5.2.50.0030.05311.90
5.2.40.0000.04311.90
5.2.30.0070.05011.90
5.2.20.0070.05711.90
5.2.10.0100.05311.90
5.2.00.0070.05711.90
5.1.60.0030.04711.90
5.1.50.0030.05311.90
5.1.40.0030.03711.90
5.1.30.0030.02711.90
5.1.20.0000.03011.90
5.1.10.0000.03711.90
5.1.00.0030.03011.90
5.0.50.0070.02311.90
5.0.40.0000.03711.90
5.0.30.0000.06311.90
5.0.20.0030.02011.90
5.0.10.0030.03011.90
5.0.00.0030.04311.90
4.4.90.0030.02711.90
4.4.80.0030.03311.90
4.4.70.0100.02711.90
4.4.60.0030.02711.90
4.4.50.0070.02711.90
4.4.40.0030.04711.90
4.4.30.0000.03311.90
4.4.20.0000.02311.90
4.4.10.0030.03711.90
4.4.00.0000.04711.90
4.3.110.0030.03011.90
4.3.100.0030.03311.90
4.3.90.0030.02011.90
4.3.80.0030.05011.90
4.3.70.0030.03311.90
4.3.60.0000.04011.90
4.3.50.0030.02711.90
4.3.40.0000.03311.90
4.3.30.0070.01011.90
4.3.20.0030.02311.90
4.3.10.0000.03711.90
4.3.00.0000.03011.90

preferences:
54.41 ms | 400 KiB | 5 Q