3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( 0 => array ( 0 => "Vaccination", 1 => "Date of entry", 2 => "Animal", 3 => "Dog", 4 => "246", 5 => "4", 6 => "984", 7 => "102", ), 1 => array ( 0 => "Vaccination", 1 => "Date of entry", 2 => "Animal", 3 => "Cat", 4 => "246", 5 => "4", 6 => "984", 7 => "118", ), ); foreach ($arr as $key => &$value) { $value = array_merge(array_slice($value, 0,3), [end($value)], array_slice($value, 3,-1)); } print_r($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 25
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 25
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/K1A9i
function name:  (null)
number of ops:  30
compiled vars:  !0 = $arr, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   28     1      > FE_RESET_RW                                      $4      !0, ->25
          2    > > FE_FETCH_RW                                      ~5      $4, !1, ->25
          3    >   ASSIGN                                                   !2, ~5
   29     4        INIT_FCALL                                               'array_merge'
          5        INIT_FCALL                                               'array_slice'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 0
          8        SEND_VAL                                                 3
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        INIT_FCALL                                               'end'
         12        SEND_REF                                                 !1
         13        DO_ICALL                                         $8      
         14        INIT_ARRAY                                       ~9      $8
         15        SEND_VAL                                                 ~9
         16        INIT_FCALL                                               'array_slice'
         17        SEND_VAR                                                 !1
         18        SEND_VAL                                                 3
         19        SEND_VAL                                                 -1
         20        DO_ICALL                                         $10     
         21        SEND_VAR                                                 $10
         22        DO_ICALL                                         $11     
         23        ASSIGN                                                   !1, $11
   28    24      > JMP                                                      ->2
         25    >   FE_FREE                                                  $4
   31    26        INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.51 ms | 1004 KiB | 17 Q