3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ '7777777777', '7777777777', '6666666666', '6666666666', '2222222222', ]; $grouped = [[], []]; foreach ($array as $i => $v) { $grouped[(int) $i & 1][] = $v; } $grouped[1] = array_reverse($grouped[1]); var_export( array_merge(...$grouped) );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/Hb1g3
function name:  (null)
number of ops:  26
compiled vars:  !0 = $array, !1 = $grouped, !2 = $v, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   12     2      > FE_RESET_R                                       $6      !0, ->11
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->11
          4    >   ASSIGN                                                   !3, ~7
   13     5        CAST                                          4  ~9      !3
          6        BW_AND                                           ~10     ~9, 1
          7        FETCH_DIM_W                                      $11     !1, ~10
          8        ASSIGN_DIM                                               $11
          9        OP_DATA                                                  !2
   12    10      > JMP                                                      ->3
         11    >   FE_FREE                                                  $6
   15    12        INIT_FCALL                                               'array_reverse'
         13        FETCH_DIM_R                                      ~14     !1, 1
         14        SEND_VAL                                                 ~14
         15        DO_ICALL                                         $15     
         16        ASSIGN_DIM                                               !1, 1
         17        OP_DATA                                                  $15
   16    18        INIT_FCALL                                               'var_export'
   17    19        INIT_FCALL                                               'array_merge'
         20        SEND_UNPACK                                              !1
         21        CHECK_UNDEF_ARGS                                         
         22        DO_ICALL                                         $16     
         23        SEND_VAR                                                 $16
   16    24        DO_ICALL                                                 
   18    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.05 ms | 1012 KiB | 16 Q