3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rrDatas = [ [], [ "asset" => 1, "person" => 1, ], [ "asset" => 2, ], [ "test" => 1, "person" => 1, ], [ "person" => 1, "banana" => "hello", "person" => 4, ], ]; $output = []; // Prepare empty output foreach($rrDatas as $inner){ foreach($inner as $key => $value){ $output[$key][] = $value; } } echo json_encode($output); // {"asset":[1,2],"person":[1]}
Output for git.master, git.master_jit, rfc.property-hooks
{"asset":[1,2],"person":[1,1,4],"test":[1],"banana":["hello"]}

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:
119.31 ms | 405 KiB | 5 Q