3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $items = array( array( 'type' => 'desktop', 'visits' => 10 ), array( 'type' => 'desktop', 'visits' => 10 ), array( 'type' => 'desktop', 'visits' => 10 ), array( 'type' => 'desktop', 'visits' => 10 ) ); $sum = array_map('array_sum',array_column($items,'visits')); var_dump($sum);
Output for 5.5.0 - 7.1.0
Warning: array_sum() expects parameter 1 to be array, integer given in /in/BpKjG on line 9 Warning: array_sum() expects parameter 1 to be array, integer given in /in/BpKjG on line 9 Warning: array_sum() expects parameter 1 to be array, integer given in /in/BpKjG on line 9 Warning: array_sum() expects parameter 1 to be array, integer given in /in/BpKjG on line 9 array(4) { [0]=> NULL [1]=> NULL [2]=> NULL [3]=> NULL }
Output for 5.0.0 - 5.4.45
Fatal error: Call to undefined function array_column() in /in/BpKjG on line 9
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_column() in /in/BpKjG on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_column() in /in/BpKjG on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_column() in /in/BpKjG on line 9