3v4l.org

run code in 300+ PHP versions simultaneously
<?php $records = array( array( 'id' => 2135, 'first_name' => 'John', 'last_name' => 'Doe', ), array( 'id' => 3245, 'first_name' => 'Sally', 'last_name' => 'Smith', ), array( 'id' => 5342, 'first_name' => 'Jane', 'last_name' => 'Jones', ), array( 'id' => 5623, 'first_name' => 'Peter', 'last_name' => 'Doe', ) ); array_walk($records, function ($v, $k) use (&$new) { $result[] = ['first_name' => $v['first_name']]; }); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a6neV
function name:  (null)
number of ops:  11
compiled vars:  !0 = $records, !1 = $new, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   26     1        INIT_FCALL                                               'array_walk'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fa6neV%3A26%240'
          4        BIND_LEXICAL                                             ~4, !1
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                                 
   27     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fa6neV%3A26%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a6neV
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $v, !1 = $k, !2 = $new, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        FETCH_DIM_R                                      ~5      !0, 'first_name'
          4        INIT_ARRAY                                       ~6      ~5, 'first_name'
          5        ASSIGN_DIM                                               !3
          6        OP_DATA                                                  ~6
          7      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fa6neV%3A26%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.63 ms | 1395 KiB | 17 Q