<?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);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/R3Tcq
function name: (null)
number of ops: 18
compiled vars: !0 = $array, !1 = $phone, !2 = $filtered
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
3 0 E > ASSIGN !0, <array>
38 1 INIT_FCALL 'array_filter'
2 INIT_FCALL 'array_column'
3 SEND_VAR !0
4 SEND_VAL 'phone'
5 DO_ICALL $4
6 SEND_VAR $4
7 DO_ICALL $5
8 ASSIGN !1, $5
40 9 INIT_FCALL 'array_intersect_key'
10 SEND_VAR !0
11 SEND_VAR !1
12 DO_ICALL $7
13 ASSIGN !2, $7
42 14 INIT_FCALL 'var_dump'
15 SEND_VAR !2
16 DO_ICALL
17 > RETURN 1
Generated using Vulcan Logic Dumper, using php 8.0.0
preferences:
138.84 ms | 1000 KiB | 17 Q