3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ "data" => "data", "id_1553539135251" => "<p>nsmn</p>", "about" => "about", "id_1553539141598" => "<p>uiu</p>", ]; $result = []; for ($i = 0; $i < count($array) / 2; $i++) { $subArray = array_slice($array, $i * 2, 2); $result[array_keys($subArray)[1]] = [ 'content' => array_values($subArray)[1], 'header' => array_values($subArray)[0], ]; } var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 4
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 4
Branch analysis from position: 32
Branch analysis from position: 4
filename:       /in/efSE3
function name:  (null)
number of ops:  36
compiled vars:  !0 = $array, !1 = $result, !2 = $i, !3 = $subArray
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1        ASSIGN                                                       !1, <array>
   12     2        ASSIGN                                                       !2, 0
          3      > JMP                                                          ->28
   13     4    >   INIT_FCALL                                                   'array_slice'
          5        SEND_VAR                                                     !0
          6        MUL                                                  ~7      !2, 2
          7        SEND_VAL                                                     ~7
          8        SEND_VAL                                                     2
          9        DO_ICALL                                             $8      
         10        ASSIGN                                                       !3, $8
   15    11        INIT_FCALL                                                   'array_keys'
         12        SEND_VAR                                                     !3
         13        DO_ICALL                                             $10     
         14        FETCH_DIM_R                                          ~11     $10, 1
   16    15        INIT_FCALL                                                   'array_values'
         16        SEND_VAR                                                     !3
         17        DO_ICALL                                             $13     
         18        FETCH_DIM_R                                          ~14     $13, 1
         19        INIT_ARRAY                                           ~15     ~14, 'content'
   17    20        INIT_FCALL                                                   'array_values'
         21        SEND_VAR                                                     !3
         22        DO_ICALL                                             $16     
         23        FETCH_DIM_R                                          ~17     $16, 0
         24        ADD_ARRAY_ELEMENT                                    ~15     ~17, 'header'
   15    25        ASSIGN_DIM                                                   !1, ~11
   17    26        OP_DATA                                                      ~15
   12    27        PRE_INC                                                      !2
         28    >   COUNT                                                ~19     !0
         29        DIV                                                  ~20     ~19, 2
         30        IS_SMALLER                                                   !2, ~20
         31      > JMPNZ                                                        ~21, ->4
   21    32    >   INIT_FCALL                                                   'var_dump'
         33        SEND_VAR                                                     !1
         34        DO_ICALL                                                     
         35      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.96 ms | 2175 KiB | 17 Q