3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = array('8708' => array('ref_id' => '93939'), '8709' => array('ref_id' => '116234'), '8710' => array('ref_id' => '116234')); $data['attr'][8] = '116234'; $filtered = array_filter($test, function($v) use($data) { return $v['ref_id'] == $data['attr'][8]; }); print_r($filtered);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fPIVo
function name:  (null)
number of ops:  15
compiled vars:  !0 = $test, !1 = $data, !2 = $filtered
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        FETCH_DIM_W                                      $4      !1, 'attr'
          2        ASSIGN_DIM                                               $4, 8
          3        OP_DATA                                                  '116234'
    5     4        INIT_FCALL                                               'array_filter'
          5        SEND_VAR                                                 !0
          6        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
          7        BIND_LEXICAL                                             ~6, !1
          8        SEND_VAL                                                 ~6
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !2, $7
    6    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fPIVo
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $v, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        FETCH_DIM_R                                      ~2      !0, 'ref_id'
          3        FETCH_DIM_R                                      ~3      !1, 'attr'
          4        FETCH_DIM_R                                      ~4      ~3, 8
          5        IS_EQUAL                                         ~5      ~2, ~4
          6      > RETURN                                                   ~5
          7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.34 ms | 1003 KiB | 15 Q