3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ [ [ 'Date' => '2021-03-15T00:00:00.0000000+01:00', 'Arena' => ['Id' => 181796, 'Name' => 'Motala bibliotek'], 'Description' => null, 'IsCanceled' => null ], [ 'Date' => '2021-03-16T00:00:00.0000000+01:00', 'Arena' => ['Id' => 181796, 'Name' => 'Motala bibliotek'], 'Description' => null, 'IsCanceled' => null ], [ 'Date' => '2021-03-17T00:00:00.0000000+01:00', 'Arena' => ['Id' => 181796, 'Name' => 'Motala bibliotek'], 'Description' => null, 'IsCanceled' => null ] ], [ [ 'Date' => '2021-03-15T00:00:00.0000000+01:00', 'Arena' => ['Id' => 181796, 'Name' => 'Motala bibliotek'], 'Description' => null, 'IsCanceled' => null ], [ 'Date' => '2021-03-16T00:00:00.0000000+01:00', 'Arena' => ['Id' => 181796, 'Name' => 'Motala bibliotek'], 'Description' => null, 'IsCanceled' => null ] ] ]; var_export( array_column(array_merge(...$data), 'Date') ); echo "\n---\n"; $result1 = []; array_walk_recursive( $data, function($v, $k) use (&$result1) { if ($k === 'Date') { $result1[] = $v; } } ); var_export($result1); echo "\n---\n"; $result2 = []; foreach ($data as $group) { array_push($result2, ...array_column($group, 'Date')); } var_export($result2); echo "\n---\n"; $result3 = []; foreach ($data as $group) { foreach ($group as $row) { if (array_key_exists('Date', $row)) { $result3[] = $row['Date']; } } } var_export($result3);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 37
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 37
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 37
2 jumps found. (Code = 77) Position 1 = 44, Position 2 = 55
Branch analysis from position: 44
2 jumps found. (Code = 78) Position 1 = 45, Position 2 = 55
Branch analysis from position: 45
2 jumps found. (Code = 77) Position 1 = 46, Position 2 = 53
Branch analysis from position: 46
2 jumps found. (Code = 78) Position 1 = 47, Position 2 = 53
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 52
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
Branch analysis from position: 52
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 53
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
Branch analysis from position: 37
filename:       /in/RmXVV
function name:  (null)
number of ops:  60
compiled vars:  !0 = $data, !1 = $result1, !2 = $result2, !3 = $group, !4 = $result3, !5 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   40     1        INIT_FCALL                                               'var_export'
   41     2        INIT_FCALL                                               'array_column'
          3        INIT_FCALL                                               'array_merge'
          4        SEND_UNPACK                                              !0
          5        CHECK_UNDEF_ARGS                                         
          6        DO_ICALL                                         $7      
          7        SEND_VAR                                                 $7
          8        SEND_VAL                                                 'Date'
          9        DO_ICALL                                         $8      
         10        SEND_VAR                                                 $8
   40    11        DO_ICALL                                                 
   44    12        ECHO                                                     '%0A---%0A'
   46    13        ASSIGN                                                   !1, <array>
   47    14        INIT_FCALL                                               'array_walk_recursive'
   48    15        SEND_REF                                                 !0
   49    16        DECLARE_LAMBDA_FUNCTION                          ~11     [0]
         17        BIND_LEXICAL                                             ~11, !1
   53    18        SEND_VAL                                                 ~11
   47    19        DO_ICALL                                                 
   55    20        INIT_FCALL                                               'var_export'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
   57    23        ECHO                                                     '%0A---%0A'
   59    24        ASSIGN                                                   !2, <array>
   60    25      > FE_RESET_R                                       $15     !0, ->37
         26    > > FE_FETCH_R                                               $15, !3, ->37
   61    27    >   INIT_FCALL                                               'array_push'
         28        SEND_REF                                                 !2
         29        INIT_FCALL                                               'array_column'
         30        SEND_VAR                                                 !3
         31        SEND_VAL                                                 'Date'
         32        DO_ICALL                                         $16     
         33        SEND_UNPACK                                              $16
         34        CHECK_UNDEF_ARGS                                         
         35        DO_ICALL                                                 
   60    36      > JMP                                                      ->26
         37    >   FE_FREE                                                  $15
   63    38        INIT_FCALL                                               'var_export'
         39        SEND_VAR                                                 !2
         40        DO_ICALL                                                 
   65    41        ECHO                                                     '%0A---%0A'
   67    42        ASSIGN                                                   !4, <array>
   68    43      > FE_RESET_R                                       $20     !0, ->55
         44    > > FE_FETCH_R                                               $20, !3, ->55
   69    45    > > FE_RESET_R                                       $21     !3, ->53
         46    > > FE_FETCH_R                                               $21, !5, ->53
   70    47    >   ARRAY_KEY_EXISTS                                         'Date', !5
         48      > JMPZ                                                     ~22, ->52
   71    49    >   FETCH_DIM_R                                      ~24     !5, 'Date'
         50        ASSIGN_DIM                                               !4
         51        OP_DATA                                                  ~24
   69    52    > > JMP                                                      ->46
         53    >   FE_FREE                                                  $21
   68    54      > JMP                                                      ->44
         55    >   FE_FREE                                                  $20
   75    56        INIT_FCALL                                               'var_export'
         57        SEND_VAR                                                 !4
         58        DO_ICALL                                                 
         59      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/RmXVV
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $v, !1 = $k, !2 = $result1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   50     3        IS_IDENTICAL                                             !1, 'Date'
          4      > JMPZ                                                     ~3, ->7
   51     5    >   ASSIGN_DIM                                               !2
          6        OP_DATA                                                  !0
   53     7    > > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.59 ms | 1009 KiB | 18 Q