3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 0 => [ "id" => 1, "name" => "Sammy", "phone" => "2348055643322", "email" => "sammy@abc.com" ], 1 => [ "id" => 2, "name" => "Saheed", "phone" => "", "email" => "saay@aol.com" ], 2 => [ "id" => 3, "name" => "Edwin", "phone" => "2348099993322", "email" => "eddy@gmail.com" ], 3 => [ "id" => 3, "name" => "Jonadab", "phone" => "2348066773322", "email" => "jonadab@gmail.com" ], 4 => [ "id" => 3, "name" => "Mercy", "phone" => "", "email" => "mercy@sysnet.com" ] ]; $phone = array_filter(array_column($array, "phone")); $filtered = array_intersect_key($array, $phone); Var_dump($filtered);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> array(4) { ["id"]=> int(1) ["name"]=> string(5) "Sammy" ["phone"]=> string(13) "2348055643322" ["email"]=> string(13) "sammy@abc.com" } [2]=> array(4) { ["id"]=> int(3) ["name"]=> string(5) "Edwin" ["phone"]=> string(13) "2348099993322" ["email"]=> string(14) "eddy@gmail.com" } [3]=> array(4) { ["id"]=> int(3) ["name"]=> string(7) "Jonadab" ["phone"]=> string(13) "2348066773322" ["email"]=> string(17) "jonadab@gmail.com" } }

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:
118.31 ms | 407 KiB | 5 Q