3v4l.org

run code in 300+ PHP versions simultaneously
<?php $people = [ ['id' => 2, 'name' => 'John Smith', 'gender' => 'male'], ['id' => 35, 'name' => 'Gareth Foo', 'gender' => 'male'], ['id' => 91, 'name' => 'John Smith', 'gender' => 'male'], ['id' => 27, 'name' => 'Bobby Smith', 'gender' => null], ['id' => 44, 'name' => 'Jane Doe', 'gender' => 'female'], ]; $selectedIds = [44, 91]; $identifiedNames = array_column($people, 'name', 'id'); $filteredNames = array_intersect_key($identifiedNames, array_flip($selectedIds)); var_export($filteredNames);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 91 => 'John Smith', 44 => 'Jane Doe', )

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:
35.95 ms | 401 KiB | 8 Q