<?php
/*
if (isset(static::$attrAccessible)) {
if (is_array(static::$attrAccessible) && count(static::$attrAccessible) > 0) {
$checkArray = array_fill_keys(static::$attrAccessible, 0);
$attributes = array_intersect_key($attributes, $checkArray);
}
} elseif (isset(static::$attrProtected)) {
if (is_array(static::$attrProtected) && count(static::$attrProtected) > 0) {
$checkArray = array_fill_keys(static::$attrProtected, 0);
$attributes = array_diff_key($attributes, $checkArray);
}
}
*/
$attrAccessible = array('name', 'age', 'location');
$attributes = array('id', 'name', 'age', 'location', 'updated_at', 'created_at');
$checkArray = array_fill_keys($attrAccessible, 0);
$purgedArray = array_intersect_key($attributes, $checkArray);
echo implode(', ', $attributes);
echo implode(', ', $purgedArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/mHhur
function name: (null)
number of ops: 23
compiled vars: !0 = $attrAccessible, !1 = $attributes, !2 = $checkArray, !3 = $purgedArray
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
17 0 E > ASSIGN !0, <array>
18 1 ASSIGN !1, <array>
20 2 INIT_FCALL 'array_fill_keys'
3 SEND_VAR !0
4 SEND_VAL 0
5 DO_ICALL $6
6 ASSIGN !2, $6
21 7 INIT_FCALL 'array_intersect_key'
8 SEND_VAR !1
9 SEND_VAR !2
10 DO_ICALL $8
11 ASSIGN !3, $8
23 12 INIT_FCALL 'implode'
13 SEND_VAL '%2C+'
14 SEND_VAR !1
15 DO_ICALL $10
16 ECHO $10
24 17 INIT_FCALL 'implode'
18 SEND_VAL '%2C+'
19 SEND_VAR !3
20 DO_ICALL $11
21 ECHO $11
22 > RETURN 1
Generated using Vulcan Logic Dumper, using php 8.0.0
preferences:
154.76 ms | 1395 KiB | 19 Q