<?php
$a = [
1 => [
[
'key' => 'fe',
'name' => 'En plantilla a dedicación completa',
'dedication' => 2,
'relationship' =>2
],
[
'key' => 'ff',
'name' => 'Freelance a dedicación completa',
'dedication' => 2,
'relationship' => 2
],
],
2 => [
[
'name' => 'En Plantilla',
'childs' => [
[
'key' => 'pem',
'name' => 'Mañanas',
'dedication' => 1,
'relationship' => 2,
'shiftPreference' => 3
],
[
'key' => 'pea',
'name' => 'Tardes',
'dedication' => 1,
'relationship' => 2,
'shiftPreference' => 3
],
[
'key' => 'ped',
'name' => 'Indistinto',
'dedication' => 4,
'relationship' => 5,
'shiftPreference' => 1
],
],
],
[
'name' => 'Freelance',
'childs' => [
[
'name' => 'Mañanas',
'childs' => [
[
'key' => 'pfmm',
'name' => 'Más de 3 horas/día',
'dedication' => 1,
'relationship' => 2,
'shiftPreference' => 3,
'hoursOfService' => 5
],
[
'key' => 'pfml',
'name' => 'Menos de 3 horas/día',
'parent' => 8,
'dedication' => 2,
'relationship' => 5,
'shiftPreference' => 32,
'hoursOfService' => 32
],
],
],
[
'name' => 'Tardes',
'childs' => [
[
'key' => 'pfam',
'name' => 'Más de 3 horas/día',
'dedication' => 1,
'relationship' => 2,
'shiftPreference' => 6,
'hoursOfService' => 4
],
[
'key' => 'pfal',
'name' => 'Menos de 3 horas/día',
'dedication' => 3,
'relationship' => 5,
'shiftPreference' => 3,
'hoursOfService' => 1
],
],
],
[
'name' => 'Indistinto',
'childs' => [
[
'key' => 'pfdm',
'name' => 'Más de 3 horas/día',
'dedication' => 21,
'relationship' => 6,
'shiftPreference' => 25,
'hoursOfService' => 2
],
[
'key' => 'pfdl',
'name' => 'Menos de 3 horas/día',
'dedication' => 434,
'relationship' => 2245243,
'shiftPreference' => 543,
'hoursOfService' => 324
],
],
],
],
],
],
];
$results = $a[1];
array_walk_recursive($results, function(&$a){
unset($a['dedication'], $a['relationship'], $a['shiftPreference'], $a['hoursOfService']);
});
var_dump($results);
var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/4LdKf
function name: (null)
number of ops: 15
compiled vars: !0 = $a, !1 = $results
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
2 0 E > ASSIGN !0, <array>
116 1 FETCH_DIM_R ~3 !0, 1
2 ASSIGN !1, ~3
117 3 INIT_FCALL 'array_walk_recursive'
4 SEND_REF !1
5 DECLARE_LAMBDA_FUNCTION '%00%7Bclosure%7D%2Fin%2F4LdKf%3A117%240'
119 6 SEND_VAL ~5
7 DO_ICALL
121 8 INIT_FCALL 'var_dump'
9 SEND_VAR !1
10 DO_ICALL
122 11 INIT_FCALL 'var_dump'
12 SEND_VAR !0
13 DO_ICALL
14 > RETURN 1
Function %00%7Bclosure%7D%2Fin%2F4LdKf%3A117%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/4LdKf
function name: {closure}
number of ops: 6
compiled vars: !0 = $a
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
117 0 E > RECV !0
118 1 UNSET_DIM !0, 'dedication'
2 UNSET_DIM !0, 'relationship'
3 UNSET_DIM !0, 'shiftPreference'
4 UNSET_DIM !0, 'hoursOfService'
119 5 > RETURN null
End of function %00%7Bclosure%7D%2Fin%2F4LdKf%3A117%240
Generated using Vulcan Logic Dumper, using php 8.0.0
preferences:
163.13 ms | 1395 KiB | 17 Q