3v4l.org

run code in 500+ 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                              ~2      [0]
          4        SEND_VAL                                                     ~2
   14     5        SEND_VAR                                                     !0
   12     6        DO_ICALL                                             $3      
   14     7        SEND_VAR                                                     $3
   11     8        DO_ICALL                                                     
   18     9        INIT_FCALL                                                   'var_export'
   19    10        INIT_FCALL                                                   'array_map'
   20    11        DECLARE_LAMBDA_FUNCTION                              ~5      [1]
         12        SEND_VAL                                                     ~5
   21    13        SEND_VAR                                                     !0
   19    14        DO_ICALL                                             $6      
   21    15        SEND_VAR                                                     $6
   18    16        DO_ICALL                                                     
   23    17      > 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/dPCVG
function name:  {closure:/in/dPCVG:13}
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 Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dPCVG
function name:  {closure:/in/dPCVG:20}
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 Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.54 ms | 2059 KiB | 16 Q