3v4l.org

run code in 300+ PHP versions simultaneously
<?php $teacherActiveGroupNameData = [ "100" => ["name" => "1 A"], "200" => ["name" => "1 B"], "300" => ["name" => "1 C"], "400" => ["name" => "1 D"], ]; $activeGroups = [ "user1" => ["100" , "200"], "user2" => ["100" , "300"], "user3" => ["100" , "200","400"], ]; array_walk($activeGroups, function (&$val) use ($teacherActiveGroupNameData) { $val = array_map(function ($val) use ($teacherActiveGroupNameData) { return $teacherActiveGroupNameData[$val]['name']; }, $val); }); echo '<pre>', print_r($activeGroups);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QCElT
function name:  (null)
number of ops:  14
compiled vars:  !0 = $teacherActiveGroupNameData, !1 = $activeGroups
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   16     2        INIT_FCALL                                               'array_walk'
          3        SEND_REF                                                 !1
          4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !0
   20     6        SEND_VAL                                                 ~4
   16     7        DO_ICALL                                                 
   22     8        ECHO                                                     '%3Cpre%3E'
          9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $6      
         12        ECHO                                                     $6
         13      > 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/QCElT
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $val, !1 = $teacherActiveGroupNameData
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   17     2        INIT_FCALL                                               'array_map'
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          4        BIND_LEXICAL                                             ~2, !1
   19     5        SEND_VAL                                                 ~2
          6        SEND_VAR                                                 !0
   17     7        DO_ICALL                                         $3      
          8        ASSIGN                                                   !0, $3
   20     9      > RETURN                                                   null


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

End of Dynamic Function 0

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.76 ms | 1013 KiB | 16 Q