3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], ]; function flip_row_col_array($array) { $out = array(); foreach ($array as $rowkey => $row) { foreach($row as $colkey => $col){ $out[$colkey][$rowkey]=$col; } } return $out; } var_export(flip_row_col_array($array));

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.30.0090.00917.57
8.5.20.0100.00717.95
8.5.10.0100.00916.73
8.5.00.0090.01119.93
8.4.180.0120.01119.66
8.4.170.0130.01120.64
8.4.160.0110.01120.62
8.4.150.0070.00516.87
8.4.140.0130.00917.77
8.4.130.0140.00718.82
8.4.120.0120.00920.40
8.4.110.0080.00418.95
8.4.100.0110.00917.75
8.4.90.0130.00720.45
8.4.80.0100.00820.37
8.4.70.0040.00618.88
8.4.60.0130.01020.47
8.4.50.0090.00720.43
8.4.40.0030.00617.67
8.4.30.0070.01318.61
8.4.20.0100.00718.04
8.4.10.0090.00021.20
8.3.300.0120.00719.25
8.3.290.0090.01120.82
8.3.280.0070.01218.32
8.3.270.0150.00516.59
8.3.260.0110.00916.71
8.3.250.0040.00516.66
8.3.240.0030.00516.88
8.3.230.0060.00216.55
8.3.220.0090.00618.80
8.3.210.0050.00318.37
8.3.200.0070.00216.57
8.3.190.0060.00317.16
8.3.180.0130.00518.90
8.3.170.0130.00617.08
8.3.160.0120.00618.96
8.3.150.0070.01116.34
8.3.140.0070.00016.69
8.3.130.0030.00616.52
8.3.120.0130.00319.08
8.3.110.0000.00820.94
8.3.100.0050.00324.06
8.3.90.0040.00426.77
8.3.80.0060.00316.63
8.3.70.0160.00616.58
8.3.60.0140.00718.56
8.3.50.0150.00224.58
8.3.40.0130.00721.90
8.3.30.0130.00618.84
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.300.0170.00620.52
8.2.290.0100.00716.84
8.2.280.0100.00920.11
8.2.270.0060.01316.61
8.2.260.0110.00317.33
8.2.250.0100.00016.57
8.2.240.0060.00318.81
8.2.230.0090.00022.58
8.2.220.0080.00437.54
8.2.210.0040.00426.77
8.2.200.0090.00016.38
8.2.190.0070.00716.58
8.2.180.0090.00925.92
8.2.170.0100.01018.95
8.2.160.0150.00022.96
8.2.150.0000.00725.66
8.2.140.0070.00024.66
8.2.130.0000.00726.16
8.2.120.0080.00026.35
8.2.110.0100.00020.90
8.2.100.0000.01117.84
8.2.90.0080.00017.90
8.2.80.0000.00818.05
8.2.70.0050.00317.93
8.2.60.0050.00318.05
8.2.50.0040.00418.05
8.2.40.0040.00419.27
8.2.30.0040.00418.13
8.2.20.0070.00017.99
8.2.10.0040.00419.22
8.2.00.0080.00019.36
8.1.340.0110.00820.28
8.1.330.0130.00517.92
8.1.320.0120.00816.29
8.1.310.0090.00616.82
8.1.300.0090.00617.80
8.1.290.0110.00418.88
8.1.280.0060.00925.92
8.1.270.0000.00823.99
8.1.260.0030.00528.09
8.1.250.0030.00528.09
8.1.240.0050.00522.18
8.1.230.0000.01120.96
8.1.220.0040.00417.74
8.1.210.0040.00418.89
8.1.200.0030.00617.36
8.1.190.0080.00017.35
8.1.180.0030.00518.10
8.1.170.0000.00818.66
8.1.160.0000.00718.77
8.1.150.0040.00418.77
8.1.140.0070.00018.93
8.1.130.0030.00520.05
8.1.120.0050.00517.47
8.1.110.0020.00517.46
8.1.100.0090.00017.46
8.1.90.0070.00017.37
8.1.80.0040.00417.30
8.1.70.0000.01117.47
8.1.60.0030.00617.58
8.1.50.0050.00217.38
8.1.40.0030.00517.45
8.1.30.0040.00417.68
8.1.20.0030.00517.61
8.1.10.0040.00417.51
8.1.00.0040.00417.46
8.0.300.0040.00419.64
8.0.290.0040.00416.75
8.0.280.0000.00718.32
8.0.270.0000.00717.92
8.0.260.0030.00318.57
8.0.250.0030.00316.99
8.0.240.0080.00016.95
8.0.230.0050.00316.80
8.0.220.0070.00016.84
8.0.210.0040.00416.92
8.0.200.0030.00316.92
8.0.190.0080.00016.96
8.0.180.0000.00716.82
8.0.170.0000.00916.93
8.0.160.0040.00416.90
8.0.150.0000.00716.86
8.0.140.0070.00016.74
8.0.130.0000.00613.33
8.0.120.0040.00416.84
8.0.110.0000.00716.76
8.0.100.0080.00016.92
8.0.90.0040.00416.78
8.0.80.0090.00916.87
8.0.70.0040.00416.86
8.0.60.0000.00816.89
8.0.50.0000.00816.92
8.0.30.0030.01317.23
8.0.20.0120.00817.16
8.0.10.0070.00016.81
8.0.00.0030.01516.71
7.4.330.0060.00015.55
7.4.320.0030.00316.59
7.4.300.0030.00316.61
7.4.290.0000.00716.45
7.4.280.0030.00616.51
7.4.270.0040.00416.60
7.4.260.0000.00513.27
7.4.250.0000.00716.57
7.4.240.0040.00416.42
7.4.230.0000.00716.63
7.4.220.0070.00016.30
7.4.210.0080.00916.56
7.4.200.0000.00716.63
7.4.130.0100.01316.43
7.4.120.0140.01016.59
7.4.110.0100.01416.44
7.4.100.0120.00616.64
7.4.90.0080.01516.29
7.4.80.0060.01216.34
7.4.70.0120.00616.46
7.4.60.0070.01016.32
7.4.50.0190.00316.47
7.4.40.0110.00716.64
7.4.30.0110.00716.57
7.4.20.0120.00816.46
7.4.10.0120.00616.52
7.4.00.0030.01416.34
7.3.330.0040.00416.38
7.3.320.0030.00313.38
7.3.310.0030.00316.39
7.3.300.0030.00316.25
7.3.290.0090.00916.35
7.3.260.0100.01416.28
7.3.250.0070.01716.57
7.3.240.0070.01016.34
7.3.230.0130.01016.36
7.3.220.0090.00916.34
7.3.210.0060.01216.43
7.3.200.0050.01116.29
7.3.190.0060.00916.23
7.3.180.0170.00716.42
7.3.170.0090.01616.39
7.3.160.0070.01016.43
7.3.150.0120.00916.60
7.3.140.0130.00316.44
7.3.130.0060.01216.35
7.3.120.0030.01516.37
7.3.110.0030.01716.43
7.3.100.0120.00616.35
7.3.90.0140.00416.41
7.3.80.0130.00316.35
7.3.70.0070.01316.43
7.3.60.0100.00716.39
7.3.50.0070.01016.54
7.3.40.0100.00716.33
7.3.30.0100.00616.46
7.3.20.0070.01116.38
7.3.10.0150.00316.47
7.3.00.0060.01116.50

preferences:
110.13 ms | 1396 KiB | 5 Q