3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['Ttitle' => 'lilly', 'Price' => 1.75, 'Number' => 3], ['Title' => 'rose', 'Price' => 1.25, 'Number' => 15], ['Title' => 'daisy', 'Price' => 0.75, 'Number' => 25], ['Title' => 'nettle', 'Price' => 2.75, 'Number' => 33], ['Title' => 'orchid', 'Price' => 1.15, 'Number' => 7], ]; var_export( array_map( fn($row) => array_combine(['Title', 'Price', 'Number'], $row), $array ) ); var_export( array_map( fn($row) => ['Title' => $row['Ttitle'] ?? $row['Title'], 'Price' => $row['Price'], 'Number' => $row['Number']], $array ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dPCVG
function name:  (null)
number of ops:  18
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'var_export'
   12     2        INIT_FCALL                                               'array_map'
   13     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FdPCVG%3A13%240'
          4        SEND_VAL                                                 ~2
   14     5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                                 
   18     9        INIT_FCALL                                               'var_export'
   19    10        INIT_FCALL                                               'array_map'
   20    11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FdPCVG%3A20%241'
         12        SEND_VAL                                                 ~5
   21    13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $6      
         15        SEND_VAR                                                 $6
         16        DO_ICALL                                                 
   23    17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FdPCVG%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dPCVG
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'array_combine'
          2        SEND_VAL                                                 <array>
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FdPCVG%3A13%240

Function %00%7Bclosure%7D%2Fin%2FdPCVG%3A20%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dPCVG
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        FETCH_DIM_IS                                     ~1      !0, 'Ttitle'
          2        COALESCE                                         ~2      ~1
          3        FETCH_DIM_R                                      ~3      !0, 'Title'
          4        QM_ASSIGN                                        ~2      ~3
          5        INIT_ARRAY                                       ~4      ~2, 'Title'
          6        FETCH_DIM_R                                      ~5      !0, 'Price'
          7        ADD_ARRAY_ELEMENT                                ~4      ~5, 'Price'
          8        FETCH_DIM_R                                      ~6      !0, 'Number'
          9        ADD_ARRAY_ELEMENT                                ~4      ~6, 'Number'
         10      > RETURN                                                   ~4
         11*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FdPCVG%3A20%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.91 ms | 1400 KiB | 19 Q