3v4l.org

run code in 500+ PHP versions simultaneously
<?php $enToCz = [ 'Monday' => 'Pondělí', 'Tuesday' => 'Úterý' ]; $data = [ ['tutor_name' => 'John Doe', 'course_day' => 'Monday',], ['tutor_name' => 'John Doe', 'course_day' => 'Tuesday',] ]; array_walk( $data, function (&$row) use ($enToCz) { $row['course_day_cz'] = $enToCz[$row['course_day']]; } ); var_export($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mc7as
function name:  (null)
number of ops:  12
compiled vars:  !0 = $enToCz, !1 = $data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    8     1        ASSIGN                                                       !1, <array>
   13     2        INIT_FCALL                                                   'array_walk'
   14     3        SEND_REF                                                     !1
   15     4        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
          5        BIND_LEXICAL                                                 ~4, !0
   17     6        SEND_VAL                                                     ~4
   13     7        DO_ICALL                                                     
   20     8        INIT_FCALL                                                   'var_export'
          9        SEND_VAR                                                     !1
         10        DO_ICALL                                                     
         11      > 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/mc7as
function name:  {closure:/in/mc7as:15}
number of ops:  7
compiled vars:  !0 = $row, !1 = $enToCz
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
   16     2        FETCH_DIM_R                                          ~3      !0, 'course_day'
          3        FETCH_DIM_R                                          ~4      !1, ~3
          4        ASSIGN_DIM                                                   !0, 'course_day_cz'
          5        OP_DATA                                                      ~4
   17     6      > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.99 ms | 2159 KiB | 15 Q