3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 2 => 'John', 21 => 'John', 32 => 'Joe', 42 => 'John', 23 => 'Joe', 62 => 'John', 25 => 'Joe', ); $flipped = []; foreach($arr AS $key => $value) { $flipped[$value][] = $key; } print_r($flipped);

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.4.10.0030.00617.61
8.3.140.0070.00716.57
8.3.130.0050.00318.65
8.3.120.0160.00320.91
8.3.110.0000.00816.91
8.3.100.0080.00024.06
8.3.90.0110.01126.77
8.3.80.0090.00018.18
8.3.70.0070.01116.38
8.3.60.0150.00418.55
8.3.50.0120.00622.98
8.3.40.0150.00018.71
8.3.30.0140.00018.42
8.3.20.0050.00320.35
8.3.10.0070.00021.72
8.3.00.0000.00819.05
8.2.260.0120.00318.34
8.2.250.0080.00016.79
8.2.240.0090.00019.14
8.2.230.0070.01020.94
8.2.220.0070.00337.54
8.2.210.0110.00426.77
8.2.200.0060.00316.50
8.2.190.0120.00316.75
8.2.180.0110.00418.41
8.2.170.0100.00622.96
8.2.160.0060.00919.24
8.2.150.0050.00224.18
8.2.140.0000.00824.66
8.2.130.0040.00420.38
8.2.120.0040.00426.35
8.2.110.0030.00622.16
8.2.100.0090.00317.85
8.2.90.0000.00818.16
8.2.80.0000.00917.97
8.2.70.0000.00817.63
8.2.60.0040.00417.93
8.2.50.0050.00518.10
8.2.40.0040.00420.64
8.2.30.0000.00819.30
8.2.20.0040.00417.61
8.2.10.0050.00318.16
8.2.00.0050.00217.99
8.1.310.0060.01020.18
8.1.300.0130.00620.26
8.1.290.0060.00330.84
8.1.280.0120.00925.92
8.1.270.0080.00023.79
8.1.260.0030.00528.09
8.1.250.0070.00028.09
8.1.240.0040.00423.80
8.1.230.0070.00420.86
8.1.220.0030.00517.74
8.1.210.0050.00318.77
8.1.200.0000.00917.36
8.1.190.0090.00017.36
8.1.180.0030.00618.10
8.1.170.0070.00418.59
8.1.160.0000.00718.99
8.1.150.0000.00718.88
8.1.140.0000.00719.52
8.1.130.0000.00717.64
8.1.120.0040.00417.45
8.1.110.0000.00817.43
8.1.100.0000.00717.47
8.1.90.0070.00017.43
8.1.80.0040.00417.34
8.1.70.0070.00017.42
8.1.60.0000.00817.46
8.1.50.0040.00417.53
8.1.40.0040.00417.47
8.1.30.0040.00417.56
8.1.20.0080.00017.62
8.1.10.0000.00717.46
8.1.00.0030.00717.32
8.0.300.0040.00420.07
8.0.290.0080.00016.75
8.0.280.0080.00018.31
8.0.270.0030.00317.29
8.0.260.0090.00017.13
8.0.250.0030.00317.04
8.0.240.0000.00816.84
8.0.230.0020.00516.90
8.0.220.0040.00416.81
8.0.210.0030.00316.78
8.0.200.0030.00316.92
8.0.190.0040.00416.97
8.0.180.0000.00716.91
8.0.170.0040.00416.83
8.0.160.0070.00016.90
8.0.150.0040.00416.69
8.0.140.0070.00016.90
8.0.130.0040.00413.27
8.0.120.0040.00416.82
8.0.110.0000.00716.96
8.0.100.0000.00816.77
8.0.90.0040.00416.79
8.0.80.0070.01316.94
8.0.70.0080.00016.71
8.0.60.0000.00816.72
8.0.50.0070.00016.75
8.0.30.0100.00816.95
8.0.20.0130.00917.40
8.0.10.0040.00417.05
8.0.00.0120.00916.88
7.4.330.0000.00615.15
7.4.320.0080.00016.64
7.4.300.0030.00316.49
7.4.290.0070.00016.46
7.4.280.0040.00416.46
7.4.270.0000.00716.45
7.4.260.0000.00716.57
7.4.250.0040.00416.36
7.4.240.0070.00016.48
7.4.230.0030.00316.66
7.4.220.0120.01016.52
7.4.210.0000.01416.69
7.4.200.0050.00216.67
7.4.160.0090.00616.42
7.4.150.0060.01217.40
7.4.140.0100.00717.86
7.4.130.0100.00616.56
7.4.120.0050.01216.47
7.4.110.0130.00416.36
7.4.100.0100.00616.50
7.4.90.0030.01316.43
7.4.80.0100.00719.39
7.4.70.0040.01216.52
7.4.60.0070.01016.48
7.4.50.0000.01016.60
7.4.40.0130.00716.58
7.4.30.0030.01216.27
7.4.00.0110.00715.02
7.3.330.0000.00613.19
7.3.320.0000.00513.05
7.3.310.0070.00016.14
7.3.300.0000.00616.34
7.3.290.0080.00816.31
7.3.280.0070.01116.35
7.3.270.0130.00317.40
7.3.260.0140.00616.44
7.3.250.0150.00816.45
7.3.240.0080.01316.32
7.3.230.0060.01316.44
7.3.210.0080.00816.23
7.3.200.0030.01316.29
7.3.190.0130.00316.61
7.3.180.0160.00016.26
7.3.170.0140.00316.31
7.3.160.0120.00316.50
7.2.330.0150.00316.44
7.2.320.0030.01316.30
7.2.310.0150.00316.71
7.2.300.0120.00416.43
7.2.290.0130.00716.39
7.2.60.0030.01017.00
7.2.00.0040.00819.41
7.1.200.0040.00815.96
7.1.70.0050.00217.27
7.1.60.0120.01219.90
7.1.00.0070.07722.30
7.0.200.0000.01114.81
7.0.70.0170.06719.95
7.0.60.0270.05020.04
7.0.50.0130.06020.28
7.0.40.0130.06020.34
7.0.30.0230.07320.44
7.0.20.0170.07020.33
7.0.10.0200.05720.35
7.0.00.0200.05720.33
5.6.280.0000.07720.91
5.6.220.0270.05020.67
5.6.210.0100.06720.52
5.6.200.0130.07321.08
5.6.190.0200.05721.16
5.6.180.0070.06721.13
5.6.170.0170.06021.02
5.6.160.0170.05721.17
5.6.150.0200.05721.08
5.6.140.0170.06021.16
5.6.130.0230.05721.03
5.6.120.0270.04721.13
5.6.110.0100.06721.07
5.6.100.0170.05721.07
5.6.90.0130.06321.09
5.6.80.0130.06020.48
5.6.70.0200.05720.43
5.6.60.0200.05320.45
5.6.50.0370.03720.39
5.6.40.0300.04720.51
5.6.30.0230.05020.46
5.6.20.0130.06020.45
5.6.10.0130.06020.51
5.6.00.0270.04720.36
5.5.360.0200.06020.41
5.5.350.0100.06720.41
5.5.340.0170.05320.83
5.5.330.0200.05320.96
5.5.320.0330.07020.79
5.5.310.0200.05720.91
5.5.300.0230.05320.96
5.5.290.0300.05020.94
5.5.280.0200.05020.88
5.5.270.0270.05320.90
5.5.260.0200.05720.95
5.5.250.0170.06020.72
5.5.240.0130.05720.23
5.5.230.0200.05720.36
5.5.220.0270.07020.34
5.5.210.0300.05320.29
5.5.200.0200.05720.34
5.5.190.0270.05020.23
5.5.180.0270.05020.14
5.5.160.0170.06320.22
5.5.150.0200.05020.16
5.5.140.0200.05020.18
5.5.130.0170.05320.28
5.5.120.0130.05720.28
5.5.110.0100.06320.25
5.5.100.0300.07020.23
5.5.90.0270.04320.22
5.5.80.0200.05320.15
5.5.70.0200.05720.05
5.5.60.0370.03720.15
5.5.50.0200.05720.11
5.5.40.0230.05020.16
5.5.30.0200.05320.11
5.5.20.0170.06020.11
5.5.10.0230.05020.09
5.5.00.0130.06320.09

preferences:
28.56 ms | 403 KiB | 5 Q