3v4l.org

run code in 500+ PHP versions simultaneously
<?php $single_Array = array(); //example array $array = array( array('t1' => 'test1'), array('t2' => 'test2'), array('t3' => 'test3'), array('t4' => 'test4'), array('t5' => 'test5')); $size = sizeof($array); //loop to fill the new single-dimensional array for($count = 0; $count<sizeof($array);$count++) { //take the key of multi-dim array $second_cell = key($array[$count]); //set the value into the new array $single_array[$count] = $array[$count][$second_cell]; } //see the results var_dump($single_array); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 6
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 6
Branch analysis from position: 19
Branch analysis from position: 6
filename:       /in/HQXkf
function name:  (null)
number of ops:  23
compiled vars:  !0 = $single_Array, !1 = $array, !2 = $size, !3 = $count, !4 = $second_cell, !5 = $single_array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    6     1        ASSIGN                                                       !1, <array>
   13     2        COUNT                                                ~8      !1
          3        ASSIGN                                                       !2, ~8
   16     4        ASSIGN                                                       !3, 0
          5      > JMP                                                          ->16
   19     6    >   INIT_FCALL                                                   'key'
          7        FETCH_DIM_R                                          ~11     !1, !3
          8        SEND_VAL                                                     ~11
          9        DO_ICALL                                             $12     
         10        ASSIGN                                                       !4, $12
   21    11        FETCH_DIM_R                                          ~15     !1, !3
         12        FETCH_DIM_R                                          ~16     ~15, !4
         13        ASSIGN_DIM                                                   !5, !3
         14        OP_DATA                                                      ~16
   16    15        PRE_INC                                                      !3
         16    >   COUNT                                                ~18     !1
         17        IS_SMALLER                                                   !3, ~18
         18      > JMPNZ                                                        ~19, ->6
   25    19    >   INIT_FCALL                                                   'var_dump'
         20        SEND_VAR                                                     !5
         21        DO_ICALL                                                     
   28    22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.15 ms | 2358 KiB | 15 Q