3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = array( '123' => array('data' => array('categories' => array( array( 'id' => '2', 'description' => 'Single-player' ), array( 'id' => '1', 'description' => 'Multi-player' ), array( 'id' => '9', 'description' => 'Co-op' ), array( 'id' => '22', 'description' => 'Steam Achievements' ), array( 'id' => '28', 'description' => 'Full controller support' ) )) ), '456' => array('data' => array('categories' => array( array( 'id' => '21', 'description' => 'Downloadable Content' ) )) ), ); //print_r($json); $merged = array(); foreach($json as $j1) { foreach($j1 as $j2) { foreach($j2 as $key => $j3) { $merged[$key][] = $j3; } } } print_r($merged);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [categories] => Array ( [0] => Array ( [0] => Array ( [id] => 2 [description] => Single-player ) [1] => Array ( [id] => 1 [description] => Multi-player ) [2] => Array ( [id] => 9 [description] => Co-op ) [3] => Array ( [id] => 22 [description] => Steam Achievements ) [4] => Array ( [id] => 28 [description] => Full controller support ) ) [1] => Array ( [0] => Array ( [id] => 21 [description] => Downloadable Content ) ) ) )

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:
56.11 ms | 404 KiB | 8 Q