3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(object1,object2,object3); $attributes = array('first_name'=>'value','last_name'=>'value'); function filter_by_key($array, $attributes) { $filtered = array(); foreach($array as $k => $v) { //if($v->$member != $value) //stuck here $filtered[$k] = $v; } return $filtered; } var_dump(filter_by_key($array, $attributes));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eides
function name:  (null)
number of ops:  16
compiled vars:  !0 = $array, !1 = $attributes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_CONSTANT                                   ~2      'object1'
          1        INIT_ARRAY                                       ~3      ~2
          2        FETCH_CONSTANT                                   ~4      'object2'
          3        ADD_ARRAY_ELEMENT                                ~3      ~4
          4        FETCH_CONSTANT                                   ~5      'object3'
          5        ADD_ARRAY_ELEMENT                                ~3      ~5
          6        ASSIGN                                                   !0, ~3
    3     7        ASSIGN                                                   !1, <array>
   14     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'filter_by_key'
         10        SEND_VAR                                                 !0
         11        SEND_VAR                                                 !1
         12        DO_FCALL                                      0  $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function filter_by_key:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/eides
function name:  filter_by_key
number of ops:  12
compiled vars:  !0 = $array, !1 = $attributes, !2 = $filtered, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ASSIGN                                                   !2, <array>
    6     3      > FE_RESET_R                                       $6      !0, ->9
          4    > > FE_FETCH_R                                       ~7      $6, !3, ->9
          5    >   ASSIGN                                                   !4, ~7
    8     6        ASSIGN_DIM                                               !2, !4
          7        OP_DATA                                                  !3
    6     8      > JMP                                                      ->4
          9    >   FE_FREE                                                  $6
   10    10      > RETURN                                                   !2
   11    11*     > RETURN                                                   null

End of function filter_by_key

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.23 ms | 1390 KiB | 16 Q