3v4l.org

run code in 300+ PHP versions simultaneously
<?php $old = array( array( 'id' => 4, 'label' => 'foo' ), array( 'id' => 6, 'label' => 'baz' ), ); $new = array_map(function($a){ return array($a['id']=>$a['label']); },$old); print_r($new);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sHhJi
function name:  (null)
number of ops:  11
compiled vars:  !0 = $old, !1 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsHhJi%3A14%240'
   16     3        SEND_VAL                                                 ~3
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
   14     6        ASSIGN                                                   !1, $4
   18     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FsHhJi%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sHhJi
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        FETCH_DIM_R                                      ~1      !0, 'id'
          2        FETCH_DIM_R                                      ~2      !0, 'label'
          3        INIT_ARRAY                                       ~3      ~2, ~1
          4      > RETURN                                                   ~3
   16     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FsHhJi%3A14%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.28 ms | 1395 KiB | 17 Q