3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function array_column( array $input, $columnKey, $indexKey=null ) { $arr = array(); if ( $indexKey !== null ) foreach ( $input as $val ) $arr[ $val[$indexKey] ] = $val[$columnKey]; else foreach ( $input as $val ) $arr[] = $val[$columnKey]; return $arr; } $a = array( array( 'id' => 1 , 'name' => 'foo' , 'date' => date('m-d-Y') ) , array( 'id' => 2 , 'name' => 'bar' , 'date' => date('m-d-Y') ) , array( 'id' => 3 , 'name' => 'george' , 'date' => date('m-d-Y') ) , array( 'id' => 4 , 'name' => 'burdell' , 'date' => date('m-d-Y') ) ); if(function_exists('array_column')) { echo('array_column '); $b = array_column($a, 'name'); }else { echo('getCols '); $b = getCols($a, 'name'); } var_dump($b);

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
5.4.450.0100.07319.45
5.4.440.0070.08019.36
5.4.430.0070.07019.55
5.4.420.0100.08019.23
5.4.410.0030.07719.23
5.4.400.0100.07019.03
5.4.390.0070.07719.18
5.4.380.0170.06719.09
5.4.370.0130.06318.88
5.4.360.0030.07719.08
5.4.350.0030.04719.21
5.4.340.0070.04318.90
5.4.320.0100.07318.85
5.4.310.0100.05019.14
5.4.300.0070.06718.96
5.4.290.0070.08019.14
5.4.280.0100.07019.12
5.4.270.0130.06719.21
5.4.260.0130.07019.03
5.4.250.0070.05719.13
5.4.240.0130.06019.13
5.4.230.0070.04319.11
5.4.220.0000.04319.04
5.4.210.0130.03319.22
5.4.200.0030.04319.04
5.4.190.0000.06018.83
5.4.180.0030.05718.93
5.4.170.0000.09019.02
5.4.160.0070.04719.15
5.4.150.0000.08318.86
5.4.140.0030.04716.34
5.4.130.0170.06016.34
5.4.120.0030.05716.46
5.4.110.0100.04016.39
5.4.100.0000.04316.35
5.4.90.0030.03716.33
5.4.80.0000.04016.35
5.4.70.0000.03716.47
5.4.60.0000.03716.41
5.4.50.0100.02316.36
5.4.40.0000.03716.37
5.4.30.0070.02716.35
5.4.20.0070.03016.35
5.4.10.0070.03316.36
5.4.00.0030.03315.91
5.3.290.0000.08014.80
5.3.280.0100.04014.71
5.3.270.0130.07314.70
5.3.260.0070.03714.70
5.3.250.0030.07714.63
5.3.240.0030.04714.57
5.3.230.0130.06714.71
5.3.220.0070.06314.52
5.3.210.0130.03314.49
5.3.200.0130.03314.50
5.3.190.0070.03714.61
5.3.180.0000.04014.56
5.3.170.0070.03314.63
5.3.160.0000.04014.55
5.3.150.0030.03714.56
5.3.140.0030.03714.64
5.3.130.0030.03714.66
5.3.120.0030.03314.57
5.3.110.0030.03714.61
5.3.100.0000.04714.15
5.3.90.0030.05313.94
5.3.80.0130.02314.04
5.3.70.0070.07314.14
5.3.60.0030.04014.06
5.3.50.0070.03313.85
5.3.40.0000.04014.04
5.3.30.0070.03014.02
5.3.20.0000.06013.81
5.3.10.0100.03013.63
5.3.00.0070.04013.74
5.2.170.0070.02711.26
5.2.160.0030.02711.04
5.2.150.0070.02711.20
5.2.140.0000.04011.13
5.2.130.0030.03311.16
5.2.120.0000.03011.01
5.2.110.0000.03011.20
5.2.100.0000.03011.21
5.2.90.0030.02711.13
5.2.80.0070.06711.10
5.2.70.0030.04311.23
5.2.60.0000.02711.05
5.2.50.0070.02311.11
5.2.40.0000.04310.91
5.2.30.0000.03311.13
5.2.20.0000.03010.99
5.2.10.0000.03010.91
5.2.00.0030.03010.84
5.1.60.0000.0579.98
5.1.50.0000.0279.88
5.1.40.0000.02710.05
5.1.30.0000.02710.20
5.1.20.0030.02710.21
5.1.10.0030.02310.17
5.1.00.0000.02710.14
5.0.50.0000.0208.58
5.0.40.0030.0178.40
5.0.30.0030.0278.21
5.0.20.0000.0208.20
5.0.10.0030.0208.05
5.0.00.0030.0338.14
4.4.90.0000.0177.27
4.4.80.0000.0237.27
4.4.70.0000.0177.27
4.4.60.0000.0177.27
4.4.50.0030.0137.27
4.4.40.0000.0377.27
4.4.30.0000.0177.27
4.4.20.0000.0177.27
4.4.10.0030.0137.27
4.4.00.0030.0237.27
4.3.110.0000.0137.27
4.3.100.0000.0137.27
4.3.90.0030.0107.27
4.3.80.0000.0277.27
4.3.70.0000.0177.27
4.3.60.0000.0177.27
4.3.50.0030.0137.27
4.3.40.0030.0207.27
4.3.30.0000.0137.27
4.3.20.0030.0237.27
4.3.10.0000.0177.27
4.3.00.0000.0137.27