3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ ['Template' => 'page.html5'], ['Template' => 'page2.html5'], ['Template' => 'page.html5'], ['Template' => 'page2.html5'], ['Template' => 'page.html5'], ['Template' => 'page2.html5'], ['id' => 27, 'table' => 'tl_custom', 'type' => 'text', 'data' => [ 'fragment' => 'example', 'previewId' => 1, 'isActive' => 1, ], ] ]; $newArr = array_unique(array_map(function ($el) { return $el['Template'] ?? serialize($el); }, $arr)); // restore the last element to array $last = array_key_last($newArr); $newArr[$last] = unserialize($newArr[$last]); echo '<pre>'; print_r($newArr); echo '</pre>';
Output for git.master, git.master_jit, rfc.property-hooks
<pre>Array ( [0] => page.html5 [1] => page2.html5 [6] => Array ( [id] => 27 [table] => tl_custom [type] => text [data] => Array ( [fragment] => example [previewId] => 1 [isActive] => 1 ) ) ) </pre>

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