3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $collection = array( 0 => array ( 0 => '1002', //Push to new array1 1 => '1003' //Push to new array2 ), 1 => array( 0 => '7', //Push to new array1 1 => '7' //Push to new array2 ), 2 => array( 0 => 'This is my first comment in the box', //Push to new array1 1 => '1This is my first comment in the box' //Push to new array2 ), 3 => array( 0 => '2014-01-01 01:16:05', //Push to new array1 1 => '2014-01-01 01:16:05' //Push to new array2 ) ); $collection = array( array_column($collection, 0), array_column($collection, 1) ); var_dump($collection);
Output for 5.5.24 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
array(2) { [0]=> array(4) { [0]=> string(4) "1002" [1]=> string(1) "7" [2]=> string(35) "This is my first comment in the box" [3]=> string(19) "2014-01-01 01:16:05" } [1]=> array(4) { [0]=> string(4) "1003" [1]=> string(1) "7" [2]=> string(36) "1This is my first comment in the box" [3]=> string(19) "2014-01-01 01:16:05" } }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.4.45
Fatal error: Call to undefined function array_column() in /in/VBlrE on line 23
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_column() in /in/VBlrE on line 23
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_column() in /in/VBlrE on line 23
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_column() in /in/VBlrE on line 23