3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ColumnKeyClass { function __toString() { return 'first_name'; } } class IndexKeyClass { function __toString() { return 'id'; } } $column_key = new ColumnKeyClass(); $index_key = new IndexKeyClass(); $records = array( array( 'id' => 2135, 'first_name' => 'John', 'last_name' => 'XXX' ), array( 'id' => 3245, 'first_name' => 'Sally', 'last_name' => 'Smith' )); var_dump($column_key); var_dump($index_key); $firstNames = array_column($records, $column_key, $index_key); print_r($firstNames); var_dump($column_key); var_dump($index_key);

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.0070.00716.61
8.3.50.0140.00516.55
8.3.40.0160.00018.45
8.3.30.0070.00718.50
8.3.20.0050.00318.57
8.3.10.0060.00320.54
8.3.00.0030.00519.13
8.2.180.0090.00616.75
8.2.170.0060.00922.96
8.2.160.0070.01020.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0080.00019.66
8.2.110.0030.00819.13
8.2.100.0070.00717.78
8.2.90.0040.00419.05
8.2.80.0080.00017.97
8.2.70.0120.00017.63
8.2.60.0000.00817.88
8.2.50.0040.00418.07
8.2.40.0030.00618.09
8.2.30.0030.00619.83
8.2.20.0040.00417.71
8.2.10.0040.00817.79
8.2.00.0040.00417.78
8.1.280.0090.00925.92
8.1.270.0080.00024.66
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0030.00621.36
8.1.230.0030.00720.73
8.1.220.0090.00018.77
8.1.210.0000.00818.84
8.1.200.0030.00617.35
8.1.190.0000.00817.39
8.1.180.0040.00418.10
8.1.170.0080.00018.71
8.1.160.0080.00018.86
8.1.150.0040.00418.66
8.1.140.0040.00417.45
8.1.130.0000.00717.86
8.1.120.0040.00417.36
8.1.110.0050.00317.31
8.1.100.0030.00517.50
8.1.90.0000.00717.38
8.1.80.0000.00717.37
8.1.70.0070.00317.43
8.1.60.0030.00617.62
8.1.50.0040.00417.44
8.1.40.0090.00017.48
8.1.30.0000.00717.65
8.1.20.0030.00517.47
8.1.10.0080.00017.52
8.1.00.0040.00417.43
8.0.300.0000.00720.06
8.0.290.0040.00416.75
8.0.280.0070.00018.50
8.0.270.0030.00316.68
8.0.260.0000.00616.80
8.0.250.0070.00016.83
8.0.240.0030.00716.82
8.0.230.0000.00817.00
8.0.220.0000.00616.77
8.0.210.0040.00416.77
8.0.200.0000.00716.85
8.0.190.0000.00916.92
8.0.180.0050.00216.84
8.0.170.0000.00816.88
8.0.160.0050.00316.87
8.0.150.0030.00516.88
8.0.140.0000.00816.80
8.0.130.0000.00613.33
8.0.120.0080.00016.82
8.0.110.0040.00316.84
8.0.100.0000.00716.69
8.0.90.0000.00716.77
8.0.80.0120.00916.77
8.0.70.0050.00216.75
8.0.60.0000.00716.91
8.0.50.0080.00016.82
8.0.30.0110.00816.99
8.0.20.0080.01117.09
8.0.10.0000.00816.93
8.0.00.0070.01416.84
7.4.330.0020.00212.93
7.4.320.0030.00316.33
7.4.300.0000.00616.39
7.4.290.0070.00016.61
7.4.280.0000.00916.50
7.4.270.0040.00416.41
7.4.260.0000.00613.19
7.4.250.0050.00316.45
7.4.240.0070.00016.51
7.4.230.0000.00616.62
7.4.220.0110.01116.34
7.4.210.0080.00816.56
7.4.200.0000.00716.33
7.4.190.0030.00316.77
7.4.160.0060.00916.71
7.4.150.0090.00916.69
7.4.140.0140.01116.55
7.4.130.0090.00816.47
7.4.120.0070.01016.39
7.4.110.0130.00316.42
7.4.100.0110.00616.28
7.4.90.0080.00916.40
7.4.80.0090.01016.24
7.4.70.0040.02016.43
7.4.60.0090.00916.38
7.4.50.0050.00016.30
7.4.40.0060.00316.28
7.4.30.0100.00616.42
7.4.00.0090.00714.86
7.3.330.0000.00613.18
7.3.320.0000.00613.18
7.3.310.0070.00016.23
7.3.300.0030.00316.10
7.3.290.0100.00316.15
7.3.280.0050.01216.22
7.3.270.0170.00716.20
7.3.260.0120.00816.17
7.3.250.0080.00916.33
7.3.240.0140.00916.14
7.3.230.0060.01116.47
7.3.210.0170.00016.23
7.3.200.0070.01419.39
7.3.190.0090.01016.32
7.3.180.0070.01016.41
7.3.170.0060.00916.43
7.3.160.0070.01016.14
7.3.120.0060.00814.76
7.3.110.0070.00714.91
7.3.100.0060.01214.50
7.3.90.0070.01014.45
7.3.80.0030.01014.97
7.3.70.0000.01214.54
7.3.60.0000.01114.65
7.3.50.0070.01214.61
7.3.40.0040.01214.66
7.3.30.0030.01014.86
7.3.20.0030.01016.35
7.3.10.0120.00316.66
7.3.00.0030.01316.75
7.2.330.0160.00916.32
7.2.320.0120.00616.25
7.2.310.0160.00616.63
7.2.300.0140.00316.50
7.2.290.0070.01016.30
7.2.250.0070.01114.90
7.2.240.0070.01315.05
7.2.230.0090.00915.07
7.2.220.0000.00914.87
7.2.210.0060.00614.77
7.2.200.0060.00914.66
7.2.190.0060.01314.85
7.2.180.0070.00414.78
7.2.170.0060.00914.91
7.2.60.0060.00616.75
7.1.330.0070.01015.68
7.1.320.0060.00615.82
7.1.310.0030.01015.71
7.1.300.0070.00715.76
7.1.290.0000.01415.72
7.1.280.0040.00415.47
7.1.270.0040.00715.79
7.1.260.0030.01015.77
7.1.200.0220.01115.45
7.1.100.0100.00616.07
7.1.70.0030.00817.06
7.1.60.0040.02219.40
7.1.50.0040.00716.89
7.1.00.0070.06322.30
7.0.200.0000.00716.70
7.0.140.0100.06722.21
7.0.120.0000.07722.17
7.0.60.0030.04320.07
7.0.50.0030.05017.87
7.0.40.0170.07720.24
7.0.30.0200.05020.24
7.0.20.0400.07320.23
7.0.10.0130.09720.24
7.0.00.0100.08720.07
5.6.280.0030.07020.92
5.6.210.0070.08320.51
5.6.200.0000.04318.28
5.6.190.0100.07320.63
5.6.180.0200.04720.51
5.6.170.0200.08720.71
5.6.160.0070.08320.52
5.6.150.0130.06718.12
5.6.140.0070.07718.34
5.6.130.0170.07718.17
5.6.120.0030.09320.97
5.6.110.0100.07320.98
5.6.100.0070.09021.04
5.6.90.0100.07721.08
5.6.80.0070.07320.39
5.5.350.0330.07020.35
5.5.340.0100.06717.95
5.5.330.0100.06720.23
5.5.320.0270.04720.30
5.5.310.0300.04720.51
5.5.300.0030.04717.90
5.5.290.0070.08318.09
5.5.280.0100.03320.78
5.5.270.0070.06720.77
5.5.260.0070.07320.77
5.5.250.0170.07020.55
5.5.240.0000.07720.16
5.4.450.0070.08019.57
5.4.440.0000.04719.57
5.4.430.0030.04019.47
5.4.420.0070.05319.52
5.4.410.0030.08019.44
5.4.400.0100.07018.93
5.4.390.0130.07018.96
5.4.380.0070.05019.14
5.4.370.0000.04019.16
5.4.360.0030.04018.92
5.4.350.0070.03318.85
5.4.340.0030.03719.08
5.4.320.0000.04018.98
5.4.310.0070.04018.85
5.4.300.0000.04018.85
5.4.290.0070.03319.24
5.4.280.0000.04719.07
5.4.270.0070.03319.14
5.4.260.0030.03719.24
5.4.250.0000.04018.84
5.4.240.0070.04319.07
5.4.230.0000.04018.83
5.4.220.0030.03719.24
5.4.210.0100.03719.18
5.4.200.0070.03319.07
5.4.190.0100.03019.04
5.4.180.0030.03719.19
5.4.170.0070.03319.14
5.4.160.0100.03018.83
5.4.150.0030.04018.83
5.4.140.0000.03716.38
5.4.130.0000.03716.50
5.4.120.0070.03716.36
5.4.110.0070.05316.54
5.4.100.0030.04316.50
5.4.90.0170.06316.45
5.4.80.0100.07016.43
5.4.70.0100.03716.44
5.4.60.0070.06016.40
5.4.50.0000.05316.38
5.4.40.0100.05316.36
5.4.30.0030.07316.38
5.4.20.0000.04716.40
5.4.10.0130.05316.39
5.4.00.0070.05015.71
5.3.290.0130.02714.82
5.3.280.0030.03714.64
5.3.270.0000.04014.66
5.3.260.0030.03714.61
5.3.250.0030.03714.61
5.3.240.0070.03314.52
5.3.230.0030.04014.62
5.3.220.0070.05014.57
5.3.210.0030.05714.49
5.3.200.0070.07014.72
5.3.190.0100.07314.63
5.3.180.0070.05714.64
5.3.170.0070.04314.61
5.3.160.0070.06714.57
5.3.150.0100.08014.59
5.3.140.0070.05714.65
5.3.130.0070.04314.57
5.3.120.0030.07714.59
5.3.110.0130.07314.70
5.3.100.0000.04713.96
5.3.90.0100.06014.07
5.3.80.0170.06013.95
5.3.70.0070.06013.91
5.3.60.0100.07314.01
5.3.50.0100.04713.97
5.3.40.0100.04313.87
5.3.30.0070.03713.80
5.3.20.0030.06013.73
5.3.10.0000.06713.69
5.3.00.0070.06013.66
5.2.170.0100.06311.22
5.2.160.0070.05311.11
5.2.150.0000.03311.15
5.2.140.0070.05711.18
5.2.130.0000.06011.20
5.2.120.0030.05311.06
5.2.110.0100.04011.18
5.2.100.0100.04311.13
5.2.90.0070.03011.16
5.2.80.0100.03311.27
5.2.70.0030.03011.16
5.2.60.0100.02711.11
5.2.50.0000.03010.97
5.2.40.0000.03311.05
5.2.30.0000.04710.94
5.2.20.0000.03310.96
5.2.10.0100.02310.86
5.2.00.0070.02310.72
5.1.60.0000.02710.02
5.1.50.0030.0339.97
5.1.40.0100.0509.98
5.1.30.0030.06010.34
5.1.20.0000.04310.35
5.1.10.0000.03710.05
5.1.00.0070.05010.01
5.0.50.0070.0178.72
5.0.40.0030.0378.72
5.0.30.0130.0338.72
5.0.20.0030.0278.72
5.0.10.0000.0338.72
5.0.00.0030.0408.72
4.4.90.0000.0208.72
4.4.80.0070.0138.72
4.4.70.0030.0138.72
4.4.60.0030.0178.72
4.4.50.0030.0138.72
4.4.40.0030.0408.72
4.4.30.0030.0138.72
4.4.20.0000.0408.72
4.4.10.0030.0208.72
4.4.00.0030.0278.72
4.3.110.0030.0338.72
4.3.100.0030.0338.72
4.3.90.0030.0238.72
4.3.80.0030.0578.72
4.3.70.0070.0108.72
4.3.60.0000.0338.72
4.3.50.0030.0308.72
4.3.40.0030.0378.72
4.3.30.0000.0338.72
4.3.20.0030.0338.72
4.3.10.0000.0308.72
4.3.00.0000.0408.72

preferences:
44.81 ms | 401 KiB | 5 Q