3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ ['plan' => 'basic'], ['plan' => 'small'], ['plan' => 'novice'], ['plan' => 'professional'], ['plan' => 'master'], ['plan' => 'promo'], ['plan' => 'newplan'] ] ]; // var_export($array); array_walk_recursive($array, function($leafvalue)use(&$flat1){$flat1[] = $leafvalue;}); var_export($flat1); echo "\n--or--\n"; var_export(array_column($array[0], 'plan')); echo "\n--or--\n"; foreach ($array[0] as $plans) { foreach ($plans as $value) { $flat2[] = $value; } } var_export($flat2); echo "\n--or--\n"; var_export(array_merge_recursive(...$array[0])['plan']);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 30
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 30
Branch analysis from position: 23
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 28
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 28
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 28
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/7jKGq
function name:  (null)
number of ops:  45
compiled vars:  !0 = $array, !1 = $flat1, !2 = $plans, !3 = $value, !4 = $flat2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_FCALL                                               'array_walk_recursive'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F7jKGq%3A15%240'
          4        BIND_LEXICAL                                             ~6, !1
          5        SEND_VAL                                                 ~6
          6        DO_ICALL                                                 
   16     7        INIT_FCALL                                               'var_export'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   18    10        ECHO                                                     '%0A--or--%0A'
   20    11        INIT_FCALL                                               'var_export'
         12        INIT_FCALL                                               'array_column'
         13        FETCH_DIM_R                                      ~9      !0, 0
         14        SEND_VAL                                                 ~9
         15        SEND_VAL                                                 'plan'
         16        DO_ICALL                                         $10     
         17        SEND_VAR                                                 $10
         18        DO_ICALL                                                 
   22    19        ECHO                                                     '%0A--or--%0A'
   24    20        FETCH_DIM_R                                      ~12     !0, 0
         21      > FE_RESET_R                                       $13     ~12, ->30
         22    > > FE_FETCH_R                                               $13, !2, ->30
   25    23    > > FE_RESET_R                                       $14     !2, ->28
         24    > > FE_FETCH_R                                               $14, !3, ->28
   26    25    >   ASSIGN_DIM                                               !4
         26        OP_DATA                                                  !3
   25    27      > JMP                                                      ->24
         28    >   FE_FREE                                                  $14
   24    29      > JMP                                                      ->22
         30    >   FE_FREE                                                  $13
   29    31        INIT_FCALL                                               'var_export'
         32        SEND_VAR                                                 !4
         33        DO_ICALL                                                 
   31    34        ECHO                                                     '%0A--or--%0A'
   33    35        INIT_FCALL                                               'var_export'
         36        INIT_FCALL                                               'array_merge_recursive'
         37        FETCH_DIM_R                                      ~17     !0, 0
         38        SEND_UNPACK                                              ~17
         39        CHECK_UNDEF_ARGS                                         
         40        DO_ICALL                                         $18     
         41        FETCH_DIM_R                                      ~19     $18, 'plan'
         42        SEND_VAL                                                 ~19
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F7jKGq%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7jKGq
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $leafvalue, !1 = $flat1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        ASSIGN_DIM                                               !1
          3        OP_DATA                                                  !0
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F7jKGq%3A15%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.01 ms | 1400 KiB | 21 Q