3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array=Array ( Array ( 'facebook' => 375, 'twitter' => 3276, 'email' => 3276 ), Array ( 'facebook' => 385, 'twitter' => 3326, 'email' => 3326 ), Array ( 'facebook' => 391, 'twitter' => 3276, 'email' => 3276 ), Array ( 'facebook' => 446, 'twitter' => 3276, 'email' => 3276 ), Array ( 'facebook' => 486, 'twitter' => 3276, 'email' => 3276 ), Array ( 'facebook' => 2, 'twitter' => 3276, 'email' => 3276 ), Array ( 'facebook' => 1, 'twitter' => 3276, 'email' => 3276 ), Array ( 'facebook' => 3, 'twitter' => 3276, 'email' => 3276 ), Array ( 'facebook' => 0, 'twitter' => 3276, 'email' => 3276 ), Array ( 'facebook' => 0, 'twitter' => 3276, 'email' => 3276 ), ); //print_r($array); //die(); //$fb=array_column($array, 'facebook'); $fb=array_map( function ($i) { return $i['facebook'];},$array); print_r($fb);
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => 375 [1] => 385 [2] => 391 [3] => 446 [4] => 486 [5] => 2 [6] => 1 [7] => 3 [8] => 0 [9] => 0 )
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/gZCY5 on line 72
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/gZCY5 on line 72
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/gZCY5 on line 72
Process exited with code 255.