3v4l.org

run code in 300+ PHP versions simultaneously
<?php function P(array $sources) { $result=array(); $cache=array(); foreach($sources as $node) { $cache=$result; $result=array(); foreach($node as $item) { if(empty($cache)) { $result[]=array($item); } else { foreach($cache as $line) { $line[]=$item; $result[]=$line; } } } } return $result; } $result=P(array( array('a', 'b'), array('a', 'b'), array('a', 'b'), array('a'), array('a'), array('a') )); print_r(array_map(function($a){return implode(",",$a);},$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.60.0090.00616.88
8.3.50.0090.00722.05
8.3.40.0110.00418.79
8.3.30.0070.00719.00
8.3.20.0060.00920.16
8.3.10.0080.00023.44
8.3.00.0060.00319.56
8.2.180.0110.00418.54
8.2.170.0150.00618.88
8.2.160.0070.00722.96
8.2.150.0050.00224.18
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00420.64
8.2.110.0080.00320.39
8.2.100.0090.00317.66
8.2.90.0040.00419.47
8.2.80.0000.00817.50
8.2.70.0000.00817.63
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0050.00320.00
8.2.30.0070.00018.17
8.2.20.0070.00017.66
8.2.10.0000.00718.05
8.2.00.0000.00717.65
8.1.280.0100.00725.92
8.1.270.0040.00422.20
8.1.260.0000.00826.35
8.1.250.0060.00328.09
8.1.240.0090.00022.06
8.1.230.0080.00321.04
8.1.220.0000.00817.76
8.1.210.0000.00819.10
8.1.200.0000.00917.35
8.1.190.0090.00017.35
8.1.180.0040.00418.78
8.1.170.0040.00418.90
8.1.160.0000.00718.90
8.1.150.0040.00418.89
8.1.140.0040.00417.43
8.1.130.0000.00717.83
8.1.120.0000.00717.44
8.1.110.0030.00617.41
8.1.100.0030.00417.44
8.1.90.0080.00017.45
8.1.80.0050.00317.45
8.1.70.0060.00317.45
8.1.60.0040.00417.47
8.1.50.0000.00717.57
8.1.40.0040.00417.48
8.1.30.0040.00417.59
8.1.20.0030.00617.67
8.1.10.0050.00217.41
8.1.00.0000.00717.43
8.0.300.0000.00720.16
8.0.290.0000.00716.63
8.0.280.0000.00818.35
8.0.270.0000.00716.81
8.0.260.0030.00317.25
8.0.250.0000.00716.80
8.0.240.0040.00416.81
8.0.230.0050.00316.86
8.0.220.0080.00016.80
8.0.210.0030.00316.82
8.0.200.0020.00516.84
8.0.190.0040.00416.94
8.0.180.0070.00016.89
8.0.170.0040.00416.92
8.0.160.0000.00816.87
8.0.150.0000.00816.79
8.0.140.0000.00716.85
8.0.130.0060.00013.34
8.0.120.0030.00516.96
8.0.110.0000.00716.87
8.0.100.0080.00016.76
8.0.90.0030.00516.86
8.0.80.0060.00916.88
8.0.70.0050.00316.93
8.0.60.0000.00816.84
8.0.50.0060.00316.72
8.0.30.0110.00717.04
8.0.20.0120.00917.40
8.0.10.0040.00416.88
8.0.00.0140.00416.81
7.4.330.0060.00015.00
7.4.320.0000.00716.52
7.4.300.0070.00016.61
7.4.290.0030.00316.61
7.4.280.0080.00016.60
7.4.270.0070.00016.52
7.4.260.0070.00016.43
7.4.250.0080.00016.48
7.4.240.0040.00416.45
7.4.230.0030.00316.62
7.4.220.0070.01116.51
7.4.210.0060.00916.68
7.4.200.0050.00216.64
7.4.150.0090.00917.40
7.4.140.0080.01217.86
7.4.130.0020.01416.62
7.4.120.0110.00616.62
7.4.110.0110.01116.59
7.4.100.0100.00716.53
7.4.90.0160.00316.43
7.4.80.0040.01519.39
7.4.70.0100.00716.42
7.4.60.0080.00816.46
7.4.50.0050.00016.65
7.4.40.0070.01016.46
7.4.30.0090.00616.43
7.4.00.0030.01015.19
7.3.330.0000.00513.33
7.3.320.0060.00013.23
7.3.310.0000.00716.40
7.3.300.0000.00716.40
7.3.290.0070.00716.39
7.3.280.0060.01116.41
7.3.270.0090.01017.40
7.3.260.0160.00716.43
7.3.250.0120.00716.44
7.3.240.0110.00716.53
7.3.230.0120.00516.64
7.3.210.0090.01316.44
7.3.200.0170.00619.39
7.3.190.0100.00716.41
7.3.180.0090.01016.35
7.3.170.0130.00316.40
7.3.160.0120.00416.43
7.3.120.0120.00014.73
7.2.330.0120.00616.45
7.2.320.0090.01016.55
7.2.310.0080.00816.70
7.2.300.0130.00316.58
7.2.290.0000.01716.36
7.2.60.0090.00616.76
7.2.00.0000.01219.61
7.1.200.0040.01115.66
7.1.100.0070.00718.20
7.1.70.0030.00517.27
7.1.60.0070.00317.22
7.1.50.0070.00317.07
7.1.40.0000.01216.67
7.1.30.0080.00416.65
7.1.20.0070.00716.62
7.1.10.0040.00416.61
7.1.00.0030.00816.95
7.0.200.0040.00416.54
7.0.190.0040.00416.64
7.0.180.0000.00716.18
7.0.170.0030.00516.23
7.0.160.0000.00916.55
7.0.150.0000.00716.40
7.0.140.0040.00716.28
7.0.130.0000.00816.50
7.0.120.0040.00416.46
7.0.110.0040.00416.55
7.0.100.0020.00516.57
7.0.90.0000.00816.44
7.0.80.0050.00516.32
7.0.70.0040.01116.17
7.0.60.0000.00815.96
7.0.50.0000.00816.29
7.0.40.0000.00815.80
7.0.30.0040.00415.80
7.0.20.0040.01115.80
7.0.10.0000.01015.80
7.0.00.0050.00515.80
5.6.300.0070.04020.87
5.6.290.0100.04420.81
5.6.280.0030.04520.82
5.6.270.0070.04020.92
5.6.260.0030.04420.98
5.6.250.0060.04121.00
5.6.240.0030.04520.89
5.6.230.0070.04020.96
5.6.220.0000.05321.01
5.6.210.0030.03921.05
5.6.200.0000.05220.93
5.6.190.0000.04420.77
5.6.180.0100.04320.94
5.6.170.0260.04220.86
5.6.160.0070.03920.84
5.6.150.0100.04320.79
5.6.140.0000.04920.74
5.6.130.0070.03720.83
5.6.120.0030.04320.87
5.6.110.0030.08121.02
5.6.100.0030.09620.76
5.6.90.0140.04520.97
5.6.80.0040.04220.21
5.6.70.0070.04120.36
5.6.60.0070.05620.20
5.6.50.0060.03520.20
5.6.40.0000.04720.21
5.6.30.0030.04320.19
5.6.20.0070.04320.20
5.6.10.0000.04620.29
5.6.00.0070.04320.37
5.5.380.0030.04917.68
5.5.370.0000.04517.56
5.5.360.0000.04717.57
5.5.350.0030.08317.52
5.5.340.0000.04717.75
5.5.330.0030.04017.74
5.5.320.0060.03518.13
5.5.310.0030.03918.14
5.5.300.0060.05118.08
5.5.290.0100.05418.12
5.5.280.0070.07517.99
5.5.270.0070.08618.09
5.5.260.0030.04418.11
5.5.250.0090.03717.55
5.5.240.0070.03717.48
5.5.230.0070.04017.41
5.5.220.0090.03517.12
5.5.210.0040.04317.47
5.5.200.0000.04417.43
5.5.190.0030.03917.48
5.5.180.0000.05817.44
5.5.160.0000.04417.37
5.5.150.0030.04117.09
5.5.140.0070.03417.29
5.5.130.0000.04017.43
5.5.120.0070.03317.09
5.5.110.0000.04417.44
5.5.100.0000.04217.36
5.5.90.0060.03516.95
5.5.80.0000.04416.99
5.5.70.0060.04117.36
5.5.60.0030.04217.33
5.5.50.0060.03317.25
5.5.40.0060.03217.30
5.5.30.0000.03917.25
5.5.20.0030.03717.32
5.5.10.0030.03717.09
5.5.00.0000.04917.36
5.4.450.0000.06319.45
5.4.440.0060.06119.32
5.4.430.0150.03519.39
5.4.420.0000.05619.46
5.4.410.0030.04119.15
5.4.400.0200.04419.09
5.4.390.0030.04018.98
5.4.380.0000.04218.90
5.4.370.0030.04518.99
5.4.360.0030.03819.08
5.4.350.0060.04419.17
5.4.340.0060.04519.24
5.4.320.0030.04219.09
5.4.310.0070.04718.98
5.4.300.0030.04019.23
5.4.290.0040.04018.95
5.4.280.0030.05019.24
5.4.270.0040.03519.14
5.4.260.0060.03618.98
5.4.250.0030.04118.94
5.4.240.0030.03719.23
5.4.230.0230.03618.96
5.4.220.0030.04118.97
5.4.210.0070.03319.19
5.4.200.0130.03019.10
5.4.190.0030.03619.20
5.4.180.0070.03318.89
5.4.170.0030.03618.99
5.4.160.0060.03819.19
5.4.150.0000.04018.93
5.4.140.0030.03516.60
5.4.130.0060.03416.45
5.4.120.0030.03316.68
5.4.110.0030.03516.60
5.4.100.0030.03916.68
5.4.90.0030.03716.64
5.4.80.0000.03716.49
5.4.70.0000.04016.47
5.4.60.0070.03316.79
5.4.50.0030.03416.70
5.4.40.0030.04216.76
5.4.30.0030.03816.67
5.4.20.0030.03616.45
5.4.10.0000.03816.46
5.4.00.0000.03716.14
5.3.290.0030.03815.80
5.3.280.0440.03015.80
5.3.270.0000.03915.80
5.3.260.0030.04315.80
5.3.250.0030.03515.80
5.3.240.0030.03515.80
5.3.230.0030.04015.80
5.3.220.0000.03815.80
5.3.210.0070.03315.80
5.3.200.0000.04015.80
5.3.190.0060.03515.80
5.3.180.0040.03915.80
5.3.170.0030.03815.80
5.3.160.0000.04115.80
5.3.150.0030.03515.80
5.3.140.0030.03815.80
5.3.130.0030.03615.80
5.3.120.0070.03315.80
5.3.110.0030.03615.80
5.3.100.0030.03615.80
5.3.90.0070.03115.80
5.3.80.0030.03815.80
5.3.70.0030.03415.80
5.3.60.0000.03715.80
5.3.50.0030.03715.80
5.3.40.0030.03315.80
5.3.30.0070.03015.80
5.3.20.0060.02915.80
5.3.10.0030.07615.80
5.3.00.0000.04615.80
5.2.170.0030.03415.80
5.2.160.0030.02815.80
5.2.150.0070.02815.80
5.2.140.0040.03215.80
5.2.130.0030.02815.80
5.2.120.0070.05815.80
5.2.110.0070.03015.80
5.2.100.0000.03215.80
5.2.90.0000.03115.80
5.2.80.0030.03015.80
5.2.70.0030.03315.80
5.2.60.0000.03415.80
5.2.50.0030.03415.80
5.2.40.0000.05115.80
5.2.30.0000.04515.80
5.2.20.0030.03215.80
5.2.10.0030.03315.80
5.2.00.0030.02615.80
5.1.60.0040.02815.80
5.1.50.0030.02515.80
5.1.40.0030.02315.80
5.1.30.0000.03115.80
5.1.20.0030.02315.80
5.1.10.0000.02615.80
5.1.00.0000.02715.80
5.0.50.0000.02715.80
5.0.40.0030.02015.80
5.0.30.0000.03415.80
5.0.20.0060.01615.80
5.0.10.0000.02515.80
5.0.00.0030.04115.80
4.4.90.0030.01315.80
4.4.80.0040.01415.80
4.4.70.0030.01515.80
4.4.60.0000.01815.80
4.4.50.0000.01815.80
4.4.40.0230.02315.80
4.4.30.0000.01615.80
4.4.20.0000.01715.80
4.4.10.0000.01615.80
4.4.00.0000.02715.80
4.3.110.0030.01515.80
4.3.100.0030.01415.80
4.3.90.0000.03715.80
4.3.80.0000.02615.80
4.3.70.0000.01615.80
4.3.60.0000.01615.80
4.3.50.0000.01815.80
4.3.40.0000.02615.80
4.3.30.0060.01315.80
4.3.20.0060.01115.80
4.3.10.0000.01615.80
4.3.00.0030.01515.80

preferences:
65.53 ms | 401 KiB | 5 Q