3v4l.org

run code in 300+ PHP versions simultaneously
<?php $firstArray =Array ( 1 => Array ( 'MemberList' => Array ( 100, '5d6', '5d7', ) ), 3 => Array ( 'MemberList' => Array ( '5d8', 200 ) ) ); $secondArray = [100,200]; $newArray = array_map( function ($v) use ($secondArray) { return ['MemberList' => array_diff($v['MemberList'], $secondArray)]; }, $firstArray ); print_r($newArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rtqq2
function name:  (null)
number of ops:  13
compiled vars:  !0 = $firstArray, !1 = $secondArray, !2 = $newArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   20     1        ASSIGN                                                   !1, <array>
   22     2        INIT_FCALL                                               'array_map'
   23     3        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
          4        BIND_LEXICAL                                             ~5, !1
   25     5        SEND_VAL                                                 ~5
   26     6        SEND_VAR                                                 !0
   22     7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !2, $6
   28     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
         12      > 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/Rtqq2
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $v, !1 = $secondArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   24     2        INIT_FCALL                                               'array_diff'
          3        FETCH_DIM_R                                      ~2      !0, 'MemberList'
          4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $3      
          7        INIT_ARRAY                                       ~4      $3, 'MemberList'
          8      > RETURN                                                   ~4
   25     9*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.26 ms | 1012 KiB | 16 Q