3v4l.org

run code in 300+ PHP versions simultaneously
<?php $team = [ ['id' => 1, 'name' => 'Team A'], ['id' => 2, 'name' => 'Team B'], ['id' => 3, 'name' => 'Team C'], ]; $people = [ ['id' => 1, 'name' => 'Mark Hamill', 'team' => 1], ['id' => 2, 'name' => 'Nicolas Cage', 'team' => 2], ['id' => 3, 'name' => 'Tom Cruise', 'team' => 3], ['id' => 4, 'name' => 'Tom Hanks', 'team' => 1], ['id' => 5, 'name' => 'Brad Pitt', 'team' => 2], ['id' => 6, 'name' => 'Paul Smith', 'team' => 3], ['id' => 7, 'name' => 'Matt Daemon', 'team' => 1], ['id' => 8, 'name' => 'Robert Redford', 'team' => 2], ]; $teampeople = array_column($people, "team"); Foreach($team as &$t){ $t['members'] = array_values(array_intersect_key($people, array_intersect($teampeople, [$t['id']]))); } Var_dump($team);

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.130.0080.00018.38
8.3.120.0000.01619.00
8.3.110.0080.00420.94
8.3.100.0000.01017.98
8.3.90.0040.00426.77
8.3.80.0030.00616.40
8.3.70.0160.00616.75
8.3.60.0160.00318.43
8.3.50.0100.00418.01
8.3.40.0120.00318.61
8.3.30.0120.00318.55
8.3.20.0050.00318.97
8.3.10.0000.00823.37
8.3.00.0080.00022.57
8.2.250.0080.00018.41
8.2.240.0090.00317.07
8.2.230.0060.00322.58
8.2.220.0060.00337.54
8.2.210.0040.00426.77
8.2.200.0030.00618.16
8.2.190.0090.00916.58
8.2.180.0160.00325.92
8.2.170.0040.01122.96
8.2.160.0000.01421.01
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0050.00319.36
8.2.110.0060.00321.05
8.2.100.0120.00017.91
8.2.90.0000.00919.76
8.2.80.0090.00217.97
8.2.70.0040.00417.93
8.2.60.0030.00518.34
8.2.50.0050.00318.10
8.2.40.0040.00421.06
8.2.30.0020.00520.66
8.2.20.0090.00018.00
8.2.10.0080.00018.05
8.2.00.0030.00619.48
8.1.300.0030.00620.23
8.1.290.0060.00330.84
8.1.280.0130.00825.92
8.1.270.0030.00623.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.74
8.1.230.0040.00822.75
8.1.220.0050.00317.75
8.1.210.0030.00619.04
8.1.200.0000.00917.35
8.1.190.0040.00417.35
8.1.180.0030.00718.10
8.1.170.0040.00418.75
8.1.160.0040.00418.95
8.1.150.0040.00418.89
8.1.140.0000.00819.05
8.1.130.0040.00418.86
8.1.120.0070.00017.41
8.1.110.0040.00417.46
8.1.100.0040.00417.45
8.1.90.0100.00017.35
8.1.80.0060.00317.48
8.1.70.0040.00417.49
8.1.60.0040.00417.51
8.1.50.0050.00317.42
8.1.40.0050.00317.54
8.1.30.0100.00017.67
8.1.20.0040.00417.65
8.1.10.0040.00417.50
8.1.00.0040.00417.46
8.0.300.0050.00219.62
8.0.290.0040.00416.75
8.0.280.0000.00818.44
8.0.270.0040.00416.73
8.0.260.0030.00318.43
8.0.250.0070.00016.97
8.0.240.0100.00016.83
8.0.230.0040.00416.82
8.0.220.0030.00516.77
8.0.210.0030.00316.93
8.0.200.0000.00616.84
8.0.190.0040.00416.97
8.0.180.0050.00216.95
8.0.170.0040.00416.93
8.0.160.0050.00316.88
8.0.150.0050.00316.81
8.0.140.0040.00416.88
8.0.130.0000.00513.25
8.0.120.0080.00016.88
8.0.110.0060.00316.76
8.0.100.0040.00416.78
8.0.90.0080.00016.89
8.0.80.0150.00016.93
8.0.70.0040.00416.99
8.0.60.0050.00316.79
8.0.50.0040.00416.84
8.0.30.0120.01017.18
8.0.20.0200.00717.40
8.0.10.0070.00016.91
8.0.00.0100.01216.93
7.4.330.0000.00515.55
7.4.320.0060.00016.64
7.4.300.0030.00316.59
7.4.290.0070.00016.51
7.4.280.0060.00316.45
7.4.270.0110.00016.65
7.4.260.0000.00716.41
7.4.250.0060.00316.37
7.4.240.0030.00316.66
7.4.230.0070.00016.64
7.4.220.0040.00416.62
7.4.210.0050.01116.61
7.4.200.0070.00016.50
7.4.160.0070.01316.50
7.4.140.0130.00717.86
7.4.130.0100.00916.53
7.4.120.0160.00716.49
7.4.110.0100.00716.57
7.4.100.0120.00616.36
7.4.90.0110.00816.43
7.4.80.0120.00619.39
7.4.70.0110.00716.58
7.4.60.0160.01416.61
7.4.50.0070.00716.65
7.4.40.0160.00316.23
7.4.10.0070.01115.11
7.4.00.0030.01214.99
7.3.330.0030.00313.16
7.3.320.0000.00613.20
7.3.310.0000.00716.18
7.3.300.0030.00316.18
7.3.290.0060.00016.22
7.3.280.0060.01016.38
7.3.260.0120.00916.42
7.3.240.0150.00716.43
7.3.230.0110.00816.39
7.3.210.0110.00716.54
7.3.200.0130.00616.60
7.3.190.0070.01016.32
7.3.180.0090.00816.56
7.3.170.0090.00916.57
7.3.160.0070.01416.35
7.3.130.0070.01014.83
7.3.120.0030.01414.84
7.3.110.0080.00814.75
7.3.100.0090.00314.89
7.3.90.0070.01115.04
7.3.80.0000.01514.73
7.3.70.0070.00714.64
7.3.60.0060.00314.80
7.3.50.0040.01114.75
7.3.40.0030.00714.82
7.3.30.0090.00614.84
7.3.20.0000.01316.55
7.3.10.0080.00616.67
7.3.00.0090.00616.69
7.2.330.0060.01216.73
7.2.320.0180.00616.55
7.2.310.0070.01016.68
7.2.300.0060.01216.72
7.2.290.0040.01516.42
7.2.260.0100.01015.05
7.2.250.0130.00615.15
7.2.240.0110.00315.18
7.2.230.0150.00015.09
7.2.220.0030.00715.24
7.2.210.0060.00614.96
7.2.200.0060.00315.07
7.2.190.0000.01615.21
7.2.180.0090.00614.80
7.2.170.0030.01414.89
7.2.160.0070.01014.91
7.2.150.0090.00616.91
7.2.140.0090.00316.82
7.2.130.0100.00816.89
7.2.120.0030.00916.94
7.2.110.0080.00716.72
7.2.100.0140.00316.74
7.2.90.0110.00217.03
7.2.80.0370.00915.74
7.2.70.0240.00715.90
7.2.60.0270.00715.85
7.2.50.0260.00615.74
7.2.40.0270.00615.86
7.2.30.0260.00615.76
7.2.20.0240.00615.82
7.2.10.0280.00815.81
7.2.00.0250.00815.98
7.1.330.0040.01115.76
7.1.320.0070.00315.62
7.1.310.0000.01415.93
7.1.300.0000.01315.96
7.1.290.0060.00315.62
7.1.280.0030.00715.87
7.1.270.0060.00615.96
7.1.260.0030.01215.91
7.1.250.0040.00815.79
7.1.240.0080.00715.68
7.1.230.0050.00715.86
7.1.220.0060.00815.77
7.1.210.0070.00615.80
7.1.200.0200.00714.79
7.1.190.0250.00714.91
7.1.180.0270.00914.69
7.1.170.0260.00714.78
7.1.160.0510.00814.79
7.1.150.0210.00914.72
7.1.140.0220.00414.84
7.1.130.0240.00614.77
7.1.120.0240.00814.88
7.1.110.0250.01014.80
7.1.100.0300.00814.84
7.1.90.0320.00714.85
7.1.80.0270.00614.92
7.1.70.0210.00714.70
7.1.60.0290.01023.94
7.1.50.0370.00723.81
7.1.40.0390.00923.82
7.1.30.0550.00623.71
7.1.20.0370.00723.64
7.1.10.0400.00614.73
7.1.00.0240.00614.82
7.0.330.0080.00615.43
7.0.320.0060.00615.37
7.0.310.0260.00314.45
7.0.300.0250.00914.37
7.0.290.0230.00714.78
7.0.280.0240.00714.24
7.0.270.0200.00314.65
7.0.260.0200.00714.80
7.0.250.0220.00314.73
7.0.240.0200.00714.81
7.0.230.0270.00714.71
7.0.220.0210.01014.82
7.0.210.0190.00814.66
7.0.200.0200.00814.76
7.0.190.0270.01114.82
7.0.180.0220.00614.78
7.0.170.0180.00814.87
7.0.160.0500.00914.65
7.0.150.0200.00814.86
7.0.140.0180.00614.81
7.0.130.0180.00914.86
7.0.120.0210.00814.79
7.0.110.0290.00514.83
7.0.100.0130.01514.77
7.0.90.0240.00814.72
7.0.80.0140.01314.75
7.0.70.0200.01014.85
7.0.60.0200.00714.81
7.0.50.0220.00714.84
7.0.40.0320.00613.52
7.0.30.0180.00913.48
7.0.20.0080.00913.51
7.0.10.0180.00713.55
7.0.00.0120.00413.42
5.6.400.0000.01614.61
5.6.390.0030.01014.30
5.6.380.0030.00614.72
5.6.370.0020.01214.31
5.6.360.0050.00914.34
5.6.350.0120.00414.22
5.6.340.0080.00814.30
5.6.330.0050.00614.46
5.6.320.0070.01014.31
5.6.310.0040.01014.24
5.6.300.0060.00814.25
5.6.290.0080.00814.56
5.6.280.0090.00714.46
5.6.270.0060.01214.50
5.6.260.0120.00614.55
5.6.250.0120.01114.22
5.6.240.0090.01014.50
5.6.230.0080.00714.43
5.6.220.0070.00814.38
5.6.210.0090.00614.40
5.6.200.0110.00914.38
5.6.190.0070.01114.52
5.6.180.0160.00414.24
5.6.170.0070.01014.40
5.6.160.0060.00814.12
5.6.150.0130.00714.30
5.6.140.0160.00414.44
5.6.130.0140.00614.42
5.6.120.0130.00914.34
5.6.110.0120.00614.39
5.6.100.0110.00814.40
5.6.90.0100.00914.25
5.6.80.0040.01314.16
5.6.70.0140.00614.26
5.6.60.0090.01014.19
5.6.50.0100.01014.24
5.6.40.0100.00814.20
5.6.30.0130.00614.30
5.6.20.0080.01014.31
5.6.10.0090.00814.15
5.6.00.0190.00614.23
5.5.380.0080.00611.13
5.5.370.0170.00310.97
5.5.360.0120.00311.02
5.5.350.0070.00311.00
5.5.340.0100.00311.19
5.5.330.0140.00211.09
5.5.320.0110.00410.95
5.5.310.0150.00811.14
5.5.300.0150.00310.87
5.5.290.0110.00411.18
5.5.280.0130.00711.25
5.5.270.0130.00811.24
5.5.260.0080.00811.19
5.5.250.0080.00811.21
5.5.240.0090.00511.21
5.5.230.0100.00711.06
5.5.220.0090.00511.07
5.5.210.0120.00911.01
5.5.200.0060.00510.96
5.5.190.0030.01211.20
5.5.180.0120.00611.27
5.5.170.0100.00912.72
5.5.160.0060.00511.13
5.5.150.0090.00511.12
5.5.140.0120.00810.92
5.5.130.0140.00410.94
5.5.120.0130.00910.94
5.5.110.0030.01111.12
5.5.100.0140.00711.18
5.5.90.0100.00910.93
5.5.80.0100.00511.01
5.5.70.0170.00711.05
5.5.60.0130.00510.90
5.5.50.0110.00310.98
5.5.40.0140.00310.93
5.5.30.0100.00711.12
5.5.20.0160.00311.04
5.5.10.0160.00210.92
5.5.00.0110.00211.08
5.4.450.0070.00610.79
5.4.440.0150.00210.55
5.4.430.0150.00510.59
5.4.420.0040.00810.64
5.4.410.0100.00510.59
5.4.400.0070.01010.51
5.4.390.0070.00710.60
5.4.380.0090.00910.63
5.4.370.0100.00510.61
5.4.360.0060.00410.67
5.4.350.0150.00310.62
5.4.340.0080.00710.70
5.4.330.0250.00210.90
5.4.320.0130.00510.88
5.4.310.0170.00410.91
5.4.300.0250.00410.83
5.4.290.0230.00310.75
5.4.280.0150.00510.78
5.4.270.0160.00310.69
5.4.260.0210.00210.88
5.4.250.0110.00610.79
5.4.240.0200.00410.79
5.4.230.0220.00310.81
5.4.220.0190.00710.83
5.4.210.0180.00610.84
5.4.200.0250.00610.88
5.4.190.0230.00510.66
5.4.180.0250.00510.91
5.4.170.0070.00910.93
5.4.160.0070.00910.85
5.4.150.0080.00610.67
5.4.140.0070.00510.94
5.4.130.0100.00510.72
5.4.120.0100.00510.88
5.4.110.0090.00410.76
5.4.100.0100.00410.82
5.4.90.0090.00310.71
5.4.80.0090.00410.81
5.4.70.0110.00310.73
5.4.60.0130.00910.68
5.4.50.0110.00510.71
5.4.40.0070.00610.88
5.4.30.0130.00110.88
5.4.20.0060.00810.75
5.4.10.0120.00210.92
5.4.00.0070.00710.64
5.3.290.0220.00210.23
5.3.280.0270.0039.98
5.3.270.0080.00610.14
5.3.260.0110.00410.20
5.3.250.0090.00610.16
5.3.240.0050.00710.02
5.3.230.0060.00810.11
5.3.220.0140.00210.02
5.3.210.0020.01110.08
5.3.200.0070.00510.05
5.3.190.0100.00510.09
5.3.180.0080.00710.29
5.3.170.0090.00310.31
5.3.160.0100.00410.22
5.3.150.0100.00310.17
5.3.140.0130.00310.11
5.3.130.0090.00410.21
5.3.120.0100.00610.29
5.3.110.0110.00510.25
5.3.100.0100.00510.31
5.3.90.0140.00710.18
5.3.80.0100.00310.07
5.3.70.0040.00810.03
5.3.60.0060.00710.20
5.3.50.0090.00210.15
5.3.40.0110.00610.09
5.3.30.0100.00410.02
5.3.20.0140.00210.11
5.3.10.0110.0109.90
5.3.00.0110.0069.82
5.2.170.0090.0039.33
5.2.160.0110.0039.27
5.2.150.0080.0059.27
5.2.140.0000.0129.27
5.2.130.0110.0049.32
5.2.120.0090.0079.27
5.2.110.0120.0019.27
5.2.100.0080.0059.27
5.2.90.0100.0029.30
5.2.80.0060.0069.27
5.2.70.0080.0039.27
5.2.60.0050.0079.27
5.2.50.0040.0049.27
5.2.40.0060.0069.27
5.2.30.0030.0079.27
5.2.20.0090.0039.27
5.2.10.0060.0059.27
5.2.00.0040.0069.27
5.1.60.0020.0049.27
5.1.50.0050.0049.27
5.1.40.0080.0019.27
5.1.30.0040.0059.27
5.1.20.0050.0019.27
5.1.10.0050.0049.27
5.1.00.0030.0059.27
5.0.50.0040.0039.27
5.0.40.0010.0059.27
5.0.30.0040.0049.27
5.0.20.0020.0059.27
5.0.10.0030.0069.27
5.0.00.0010.0079.27
4.4.90.0030.0039.27
4.4.80.0050.0039.27
4.4.70.0030.0039.27
4.4.60.0040.0029.27
4.4.50.0030.0059.27
4.4.40.0030.0049.27
4.4.30.0020.0059.27
4.4.20.0030.0029.27
4.4.10.0040.0019.27
4.4.00.0020.0059.27
4.3.110.0020.0059.27
4.3.100.0020.0059.27
4.3.90.0050.0029.27
4.3.80.0070.0009.27
4.3.70.0060.0029.27
4.3.60.0020.0059.27
4.3.50.0050.0029.27
4.3.40.0000.0069.27
4.3.30.0060.0009.27
4.3.20.0020.0069.27
4.3.10.0040.0039.27
4.3.00.0030.0029.27

preferences:
31.04 ms | 403 KiB | 5 Q