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 == count( $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, $i)); } 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.40.0070.00718.84
8.3.30.0070.00720.35
8.3.20.0040.00420.32
8.3.10.0080.00021.05
8.3.00.0080.00023.45
8.2.170.0040.01122.96
8.2.160.0110.00320.46
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0080.00021.00
8.2.110.0120.00019.24
8.2.100.0080.00417.84
8.2.90.0000.00819.21
8.2.80.0050.00318.05
8.2.70.0090.00317.50
8.2.60.0030.00718.05
8.2.50.0030.00518.07
8.2.40.0040.00418.22
8.2.30.0070.00019.41
8.2.20.0000.00717.59
8.2.10.0030.00517.64
8.2.00.0050.00317.67
8.1.270.0040.00423.99
8.1.260.0000.00926.35
8.1.250.0000.00728.09
8.1.240.0030.00922.52
8.1.230.0070.00420.95
8.1.220.0000.00818.77
8.1.210.0050.00319.04
8.1.200.0060.00317.23
8.1.190.0000.00817.53
8.1.180.0070.00018.10
8.1.170.0110.00018.56
8.1.160.0050.00219.02
8.1.150.0040.00418.54
8.1.140.0030.00517.47
8.1.130.0000.00717.84
8.1.120.0040.00417.49
8.1.110.0000.00717.49
8.1.100.0040.00317.40
8.1.90.0040.00417.38
8.1.80.0000.00717.48
8.1.70.0030.00317.43
8.1.60.0000.00717.64
8.1.50.0050.00317.50
8.1.40.0040.00417.46
8.1.30.0000.00817.61
8.1.20.0000.00917.61
8.1.10.0030.00517.60
8.1.00.0040.00417.31
8.0.300.0060.00319.95
8.0.290.0000.00717.05
8.0.280.0030.00318.47
8.0.270.0070.00217.34
8.0.260.0000.00816.89
8.0.250.0050.00316.97
8.0.240.0000.00816.95
8.0.230.0030.00316.97
8.0.220.0030.00316.93
8.0.210.0040.00416.79
8.0.200.0030.00317.02
8.0.190.0080.00016.87
8.0.180.0040.00416.93
8.0.170.0000.00716.89
8.0.160.0000.00816.97
8.0.150.0000.00716.87
8.0.140.0100.00016.84
8.0.130.0000.00613.28
8.0.120.0040.00416.84
8.0.110.0080.00016.98
8.0.100.0020.00516.91
8.0.90.0000.00816.91
8.0.80.0090.00916.89
8.0.70.0000.00716.94
8.0.60.0000.00816.79
8.0.50.0040.00416.91
8.0.30.0140.00717.14
8.0.20.0130.00717.40
8.0.10.0050.00217.02
8.0.00.0100.01116.78
7.4.330.0000.00515.02
7.4.320.0050.00216.51
7.4.300.0030.00316.53
7.4.290.0000.00716.62
7.4.280.0050.00216.54
7.4.270.0030.00316.54
7.4.260.0000.00613.36
7.4.250.0000.00816.54
7.4.240.0050.00216.63
7.4.230.0000.00716.52
7.4.220.0110.01416.61
7.4.210.0060.00916.63
7.4.200.0040.00416.37
7.4.190.0040.00416.50
7.4.160.0130.00416.55
7.4.150.0120.00617.40
7.4.140.0040.01417.86
7.4.130.0120.00516.55
7.4.120.0120.00616.53
7.4.110.0140.00516.53
7.4.100.0110.00716.54
7.4.90.0120.00716.41
7.4.80.0100.00719.39
7.4.70.0090.00916.68
7.4.60.0090.00916.36
7.4.50.0060.00316.50
7.4.40.0030.01322.77
7.4.30.0080.00816.53
7.4.00.0060.01215.07
7.3.330.0060.00013.33
7.3.320.0000.00613.32
7.3.310.0070.00016.30
7.3.300.0000.00716.20
7.3.290.0060.00616.29
7.3.280.0060.01016.31
7.3.270.0070.01117.40
7.3.260.0100.00818.24
7.3.250.0130.00416.49
7.3.240.0070.01116.46
7.3.230.0120.00616.63
7.3.210.0090.00916.54
7.3.200.0070.01419.39
7.3.190.0070.01016.63
7.3.180.0070.01016.53
7.3.170.0070.01016.34
7.3.160.0090.00916.42
7.3.120.0090.00615.00
7.3.00.0070.00716.50
7.2.330.0120.02516.72
7.2.320.0100.00816.89
7.2.310.0040.01316.82
7.2.300.0140.00416.54
7.2.290.0160.00616.72
7.2.130.0060.00617.05
7.2.120.0060.00917.04
7.2.110.0100.00716.64
7.2.100.0030.01016.96
7.2.90.0030.00716.94
7.2.80.0000.01416.87
7.2.70.0060.00616.64
7.2.60.0060.00816.91
7.2.50.0000.01517.01
7.2.40.0030.00617.06
7.2.30.0120.00416.83
7.2.20.0000.01216.98
7.2.10.0000.01316.80
7.2.00.0050.00818.14
7.1.250.0100.00315.97
7.1.240.0000.00816.00
7.1.230.0000.01215.55
7.1.220.0030.00715.63
7.1.210.0100.00015.86
7.1.200.0050.00515.81
7.1.190.0080.00815.77
7.1.180.0060.00615.72
7.1.170.0040.00415.86
7.1.160.0080.00615.62
7.1.150.0070.00715.94
7.1.140.0030.01015.76
7.1.130.0000.01515.73
7.1.120.0030.00915.57
7.1.110.0110.00615.66
7.1.100.0080.00616.83
7.1.90.0070.00715.75
7.1.80.0030.00915.77
7.1.70.0020.00616.43
7.1.60.0060.01017.39
7.1.50.0100.00816.36
7.1.40.0060.00815.77
7.1.30.0120.00015.69
7.1.20.0040.00715.79
7.1.10.0100.00315.62
7.1.00.0030.04219.25
7.0.330.0090.00315.43
7.0.320.0070.00315.37
7.0.310.0030.01015.66
7.0.300.0030.01015.43
7.0.290.0060.00615.47
7.0.280.0070.00715.39
7.0.270.0090.00615.63
7.0.260.0000.01115.47
7.0.250.0050.00315.52
7.0.240.0030.00915.66
7.0.230.0130.00315.54
7.0.220.0030.00715.23
7.0.210.0000.01415.55
7.0.200.0050.01016.27
7.0.190.0000.01215.50
7.0.180.0030.00915.44
7.0.170.0000.00915.58
7.0.160.0070.00315.50
7.0.150.0040.00415.50
7.0.140.0080.03718.78
7.0.130.0000.01315.63
7.0.120.0030.00915.48
7.0.110.0000.01015.52
7.0.100.0030.02718.50
7.0.90.0080.02818.66
7.0.80.0070.02018.44
7.0.70.0020.03918.50
7.0.60.0050.03518.73
7.0.50.0030.02618.90
7.0.40.0020.02316.84
7.0.30.0030.02516.81
7.0.20.0070.01816.74
7.0.10.0020.02516.71
7.0.00.0020.02816.80
5.6.380.0030.01014.09
5.6.370.0090.00314.44
5.6.360.0000.01414.64
5.6.350.0070.00714.21
5.6.340.0100.00314.48
5.6.330.0040.01113.99
5.6.320.0040.01214.20
5.6.310.0060.01014.42
5.6.300.0080.00614.34
5.6.290.0070.00714.39
5.6.280.0050.04117.70
5.6.270.0030.01014.65
5.6.260.0090.00314.61
5.6.250.0050.02917.76
5.6.240.0060.02117.47
5.6.230.0020.02717.53
5.6.220.0090.01817.42
5.6.210.0020.02717.49
5.6.200.0050.02517.67
5.6.190.0050.02717.72
5.6.180.0020.02817.69
5.6.170.0080.02017.79
5.6.160.0070.02217.71
5.6.150.0030.02217.68
5.6.140.0030.02717.81
5.6.130.0090.02017.81
5.6.120.0070.02217.90
5.6.110.0020.02717.60
5.6.100.0000.02717.88
5.6.90.0040.02617.60
5.6.80.0030.04017.44
5.6.70.0050.02317.31
5.6.60.0030.04117.47
5.6.50.0080.03917.43
5.6.40.0020.04017.27
5.6.30.0090.03917.21
5.6.20.0060.02817.26
5.6.10.0070.04017.38
5.6.00.0060.04017.49
5.5.380.0030.02515.85
5.5.370.0050.02216.00
5.5.360.0030.04415.88
5.5.350.0020.02815.72
5.5.340.0060.02115.90
5.5.330.0050.02516.12
5.5.320.0050.01816.15
5.5.310.0050.02416.27
5.5.300.0020.02615.96
5.5.290.0020.02315.93
5.5.280.0020.02416.03
5.5.270.0050.02016.11
5.5.260.0050.03715.94
5.5.250.0030.02815.97
5.5.240.0020.04215.79
5.5.230.0080.04115.66
5.5.220.0100.02315.74
5.5.210.0050.03515.63
5.5.200.0050.03715.70
5.5.190.0020.04415.62
5.5.180.0030.04615.63
5.5.170.0070.00411.00
5.5.160.0080.04015.63
5.5.150.0080.04015.70
5.5.140.0020.03915.49
5.5.130.0030.03715.70
5.5.120.0080.03615.56
5.5.110.0060.03515.66
5.5.100.0050.03815.62
5.5.90.0040.04215.58
5.5.80.0130.02015.53
5.5.70.0020.04215.64
5.5.60.0100.03715.53
5.5.50.0070.04015.70
5.5.40.0030.02915.53
5.5.30.0040.04215.55
5.5.20.0030.04315.72
5.5.10.0030.04315.53
5.5.00.0060.04015.58
5.4.450.0040.02315.12
5.4.440.0000.02115.25
5.4.430.0020.02815.18
5.4.420.0020.02015.32
5.4.410.0020.02215.17
5.4.400.0030.02315.06
5.4.390.0010.04315.10
5.4.380.0020.04115.02
5.4.370.0040.04415.17
5.4.360.0090.03515.13
5.4.350.0030.03715.02
5.4.340.0130.03515.02
5.4.330.0030.00611.00
5.4.320.0040.02515.13
5.4.310.0050.02815.06
5.4.300.0070.03615.06
5.4.290.0070.03715.06
5.4.280.0050.04015.09
5.4.270.0040.04014.95
5.4.260.0020.02815.09
5.4.250.0030.02815.23
5.4.240.0050.03515.18
5.4.230.0050.04015.14
5.4.220.0050.02515.05
5.4.210.0050.03714.97
5.4.200.0020.03815.08
5.4.190.0030.03914.96
5.4.180.0050.03915.02
5.4.170.0030.03815.14
5.4.160.0040.03915.08
5.4.150.0020.04314.96
5.4.140.0050.03913.79
5.4.130.0070.03713.67
5.4.120.0050.03813.86
5.4.110.0020.03813.73
5.4.100.0050.02013.79
5.4.90.0020.02513.76
5.4.80.0030.03813.75
5.4.70.0020.03713.75
5.4.60.0060.03513.85
5.4.50.0020.03313.70
5.4.40.0020.04313.87
5.4.30.0060.03613.85
5.4.20.0020.03913.77
5.4.10.0030.02413.78
5.4.00.0020.04213.54
5.3.290.0070.04012.82
5.3.280.0000.02312.72
5.3.270.0030.03512.79
5.3.260.0090.04012.80
5.3.250.0010.02912.81
5.3.240.0040.04212.81
5.3.230.0020.02712.72
5.3.220.0050.04012.71
5.3.210.0010.02612.79
5.3.200.0040.02012.76
5.3.190.0030.02612.70
5.3.180.0030.03812.77
5.3.170.0030.02812.79
5.3.160.0020.04312.69
5.3.150.0070.02812.76
5.3.140.0040.02112.77
5.3.130.0020.04012.69
5.3.120.0030.04012.75
5.3.110.0060.02812.70
5.3.100.0050.04012.53
5.3.90.0060.02012.51
5.3.80.0050.03512.49
5.3.70.0050.03712.44
5.3.60.0000.02912.48
5.3.50.0050.03812.48
5.3.40.0030.03812.43
5.3.30.0030.04012.41
5.3.20.0030.03712.31
5.3.10.0070.03512.32
5.3.00.0020.03612.31
5.2.170.0060.03011.08
5.2.160.0040.01711.11
5.2.150.0030.03511.07
5.2.140.0000.03211.08
5.2.130.0000.03111.07
5.2.120.0030.03311.05
5.2.110.0030.01811.06
5.2.100.0070.01811.03
5.2.90.0010.03310.98
5.2.80.0000.02311.07
5.2.70.0010.03111.01
5.2.60.0020.03111.05
5.2.50.0070.02810.92
5.2.40.0050.03110.91
5.2.30.0020.02210.92
5.2.20.0040.03010.96
5.2.10.0020.03410.89
5.2.00.0040.03210.87
5.1.60.0020.02710.51
5.1.50.0040.02710.49
5.1.40.0030.02010.52
5.1.30.0000.03410.62
5.1.20.0030.03010.64
5.1.10.0070.02310.55
5.1.00.0010.03110.55
5.0.50.0000.02710.42
5.0.40.0040.01310.42
5.0.30.0040.03010.42
5.0.20.0040.01710.42
5.0.10.0010.02310.42
5.0.00.0050.03210.42
4.4.90.0000.01310.42
4.4.80.0030.01310.42
4.4.70.0020.02010.42
4.4.60.0000.01310.42
4.4.50.0000.02110.42
4.4.40.0020.02710.42
4.4.30.0020.01210.42
4.4.20.0040.01110.42
4.4.10.0030.01810.42
4.4.00.0050.02510.42
4.3.110.0040.01910.42
4.3.100.0030.02010.42
4.3.90.0040.01810.42
4.3.80.0010.02510.42
4.3.70.0040.01610.42
4.3.60.0020.02010.42
4.3.50.0020.01910.42
4.3.40.0000.02610.42
4.3.30.0000.02210.42
4.3.20.0000.02010.42
4.3.10.0020.01810.42
4.3.00.0030.01810.42

preferences:
44.24 ms | 400 KiB | 5 Q