<?php
// Examples 1 & 2 from http://nl3.php.net/array_column
$records = array(
4 => array(
'id' => 2135,
'first_name' => 'John',
'last_name' => 'Doe',
),
8 => array(
'id' => 3245,
'first_name' => 'Sally',
'last_name' => 'Smith',
),
2 => array(
'id' => 5342,
'first_name' => 'Jane',
'last_name' => 'Jones',
),
'00013411' => array(
'id' => 5623,
'first_name' => 'Peter',
'last_name' => 'Doe',
)
);
// Example 1: original indexes are lost =(
print_r(array_column($records, 'first_name'));
// Example 2: new indexes are 'id' column
print_r(array_column($records, 'last_name', 'id'));
// Example 3: full objects by 'last_name'
print_r(array_column($records, null, 'last_name'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/9kpKa
function name: (null)
number of ops: 25
compiled vars: !0 = $records
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
5 0 E > ASSIGN !0, <array>
29 1 INIT_FCALL 'print_r'
2 INIT_FCALL 'array_column'
3 SEND_VAR !0
4 SEND_VAL 'first_name'
5 DO_ICALL $2
6 SEND_VAR $2
7 DO_ICALL
32 8 INIT_FCALL 'print_r'
9 INIT_FCALL 'array_column'
10 SEND_VAR !0
11 SEND_VAL 'last_name'
12 SEND_VAL 'id'
13 DO_ICALL $4
14 SEND_VAR $4
15 DO_ICALL
35 16 INIT_FCALL 'print_r'
17 INIT_FCALL 'array_column'
18 SEND_VAR !0
19 SEND_VAL null
20 SEND_VAL 'last_name'
21 DO_ICALL $6
22 SEND_VAR $6
23 DO_ICALL
24 > RETURN 1
Generated using Vulcan Logic Dumper, using php 8.0.0
preferences:
148.91 ms | 1399 KiB | 17 Q