3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = 'key1'; $testArray = array ( 'subArray1' => array( 'key1' => "Sub array 1 value 1", 'key2' => "Sub array 1 value 1" ), 'subArray2' => array( 'key1' => "Sub array 2 value 1", 'key2' => "Sub array 2 value 2" ) ); $output = array_column($testArray, $key); var_dump($output); var_dump(array_combine(array_keys($testArray), array_column($testArray, $key)));
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> string(19) "Sub array 1 value 1" [1]=> string(19) "Sub array 2 value 1" } array(2) { ["subArray1"]=> string(19) "Sub array 1 value 1" ["subArray2"]=> string(19) "Sub array 2 value 1" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
51.17 ms | 401 KiB | 8 Q