3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xyz = array( array('name' => 'abc'), array("name" => "snds"), array("name" => ""), array("number" => "452"), array("number" => "845120"), array("number" => "84514513200"), array("email" => "ddddf"), array("email" => "dkskns"), array("email" => "kjnksdnkds") ); $result = []; $count = 0; foreach ($xyz as $value) { if ($count%3 === 0) { $count = 0; } $result[$count][array_keys($value)[0]] = reset($value); $count++; } var_dump($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 21
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/9DDeo
function name:  (null)
number of ops:  26
compiled vars:  !0 = $xyz, !1 = $result, !2 = $count, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   16     1        ASSIGN                                                   !1, <array>
   17     2        ASSIGN                                                   !2, 0
   18     3      > FE_RESET_R                                       $7      !0, ->21
          4    > > FE_FETCH_R                                               $7, !3, ->21
   19     5    >   MOD                                              ~8      !2, 3
          6        IS_IDENTICAL                                             ~8, 0
          7      > JMPZ                                                     ~9, ->9
   20     8    >   ASSIGN                                                   !2, 0
   22     9    >   INIT_FCALL                                               'array_keys'
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                         $12     
         12        FETCH_DIM_R                                      ~13     $12, 0
         13        INIT_FCALL                                               'reset'
         14        SEND_REF                                                 !3
         15        DO_ICALL                                         $15     
         16        FETCH_DIM_W                                      $11     !1, !2
         17        ASSIGN_DIM                                               $11, ~13
         18        OP_DATA                                                  $15
   23    19        PRE_INC                                                  !2
   18    20      > JMP                                                      ->4
         21    >   FE_FREE                                                  $7
   26    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.69 ms | 1406 KiB | 19 Q