3v4l.org

run code in 500+ PHP versions simultaneously
<?php $oldArray = [ 0 => ['id' => 5, 'value' => 50], 1 => ['id' => 6, 'value' => 60], 2 => ['id' => 7, 'value' => 70], ]; $newArray = array_column($oldArray, 'value', 'id'); array_walk($newArray, function(&$value) { $value = ['value' => $value]; }); var_dump($newArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nWdfg
function name:  (null)
number of ops:  16
compiled vars:  !0 = $oldArray, !1 = $newArray
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        INIT_FCALL                                                   'array_column'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     'value'
          4        SEND_VAL                                                     'id'
          5        DO_ICALL                                             $3      
          6        ASSIGN                                                       !1, $3
   10     7        INIT_FCALL                                                   'array_walk'
          8        SEND_REF                                                     !1
          9        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
         10        SEND_VAL                                                     ~5
         11        DO_ICALL                                                     
   12    12        INIT_FCALL                                                   'var_dump'
         13        SEND_VAR                                                     !1
         14        DO_ICALL                                                     
         15      > 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/nWdfg
function name:  {closure:/in/nWdfg:10}
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
          1        INIT_ARRAY                                           ~1      !0, 'value'
          2        ASSIGN                                                       !0, ~1
          3      > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.13 ms | 2277 KiB | 16 Q