3v4l.org

run code in 300+ PHP versions simultaneously
<?php $topics = [ [ "id" => 1, "statusName" => "COMPLETED", "lessons" => [ [ "id" => 1, "statusName" => "COMPLETED" ], [ "id" => 1, "statusName" => "COMPLETED" ], ] ], [ "id" => 2, "statusName" => "SCHEDULED", "lessons" => [ [ "id" => 1, "statusName" => "SCHEDULED" ], [ "id" => 1, "statusName" => "COMPLETED" ], ] ] ]; foreach ($topics as $key => $value) { $topics[$key]['lessons'] = array_map(function ($lesson) use ($value) { $lesson['reschedule'] = true; return $lesson; }, $value['lessons']); } var_dump($topics);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/HVVbL
function name:  (null)
number of ops:  20
compiled vars:  !0 = $topics, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   34     1      > FE_RESET_R                                       $4      !0, ->15
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->15
          3    >   ASSIGN                                                   !2, ~5
   35     4        INIT_FCALL                                               'array_map'
          5        DECLARE_LAMBDA_FUNCTION                          ~9      [0]
          6        BIND_LEXICAL                                             ~9, !1
   40     7        SEND_VAL                                                 ~9
          8        FETCH_DIM_R                                      ~10     !1, 'lessons'
          9        SEND_VAL                                                 ~10
   35    10        DO_ICALL                                         $11     
         11        FETCH_DIM_W                                      $7      !0, !2
         12        ASSIGN_DIM                                               $7, 'lessons'
   40    13        OP_DATA                                                  $11
   34    14      > JMP                                                      ->2
         15    >   FE_FREE                                                  $4
   43    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
         19      > 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/HVVbL
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $lesson, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   37     2        ASSIGN_DIM                                               !0, 'reschedule'
          3        OP_DATA                                                  <true>
   38     4      > RETURN                                                   !0
   40     5*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.75 ms | 1000 KiB | 15 Q