3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ ['brand' => 'a', 'model' => 'a', 'foo' => 'bar'], ['brand' => 'b', 'model' => 'b', 'foo' => 'b'], ['brand' => 'c', 'model' => 'c', 'foo' => 'c'], ['brand' => 'd', 'model' => 'd', 'foo' => 'd'], ['brand' => 'e', 'model' => 'e', 'foo' => 'e'], ]; $data = array_map(function($item) { return [ 'brand' => $item['brand'], 'model' => $item['model'] ]; }, $data); var_dump($data);
Output for git.master, git.master_jit, rfc.property-hooks
array(5) { [0]=> array(2) { ["brand"]=> string(1) "a" ["model"]=> string(1) "a" } [1]=> array(2) { ["brand"]=> string(1) "b" ["model"]=> string(1) "b" } [2]=> array(2) { ["brand"]=> string(1) "c" ["model"]=> string(1) "c" } [3]=> array(2) { ["brand"]=> string(1) "d" ["model"]=> string(1) "d" } [4]=> array(2) { ["brand"]=> string(1) "e" ["model"]=> string(1) "e" } }

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:
137.62 ms | 406 KiB | 5 Q