3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ ['color' => 'RED'], ['color' => 'BLUE'], ['color' => 'GREEN'] ], [ ['color' => 'RED'], ['color' => 'PURPLE'], ['color' => 'RED'] ] ]; $result = []; foreach ($array as $row) { $result[] = array_values(array_column($row, null, 'color')); } echo json_encode($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/XiAfe
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array, !1 = $result, !2 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   17     1        ASSIGN                                                   !1, <array>
   18     2      > FE_RESET_R                                       $5      !0, ->15
          3    > > FE_FETCH_R                                               $5, !2, ->15
   19     4    >   INIT_FCALL                                               'array_values'
          5        INIT_FCALL                                               'array_column'
          6        SEND_VAR                                                 !2
          7        SEND_VAL                                                 null
          8        SEND_VAL                                                 'color'
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        DO_ICALL                                         $8      
         12        ASSIGN_DIM                                               !1
         13        OP_DATA                                                  $8
   18    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $5
   21    16        INIT_FCALL                                               'json_encode'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $9      
         19        ECHO                                                     $9
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.11 ms | 1006 KiB | 16 Q