3v4l.org

run code in 300+ PHP versions simultaneously
<?php $originalArray = array( 'dates' => '2021-10-20', 'hours' => array( 0 => array ( 0 => '07:30', 1 => '08:00', 2 => '08:30', 3 => '09:00', 4 => '09:30', 5 => '10:00', 6 => '10:30', 7 => '11:00', 8 => '11:30', 9 => '12:00', 10 => '12:30', 11 => '13:00' ), 1 => array ( 0 => '15:30', 1 => '16:00', 2 => '16:30', 3 => '17:00' ) ) ); $newArray = array(); foreach($originalArray['hours'] as $k=>$hours){ $newArray[$k]['dates'] = $originalArray['dates']; $newArray[$k]['hours'] = $hours; } print_r($newArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/oE3hh
function name:  (null)
number of ops:  19
compiled vars:  !0 = $originalArray, !1 = $newArray, !2 = $hours, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   29     1        ASSIGN                                                   !1, <array>
   31     2        FETCH_DIM_R                                      ~6      !0, 'hours'
          3      > FE_RESET_R                                       $7      ~6, ->14
          4    > > FE_FETCH_R                                       ~8      $7, !2, ->14
          5    >   ASSIGN                                                   !3, ~8
   32     6        FETCH_DIM_R                                      ~12     !0, 'dates'
          7        FETCH_DIM_W                                      $10     !1, !3
          8        ASSIGN_DIM                                               $10, 'dates'
          9        OP_DATA                                                  ~12
   33    10        FETCH_DIM_W                                      $13     !1, !3
         11        ASSIGN_DIM                                               $13, 'hours'
         12        OP_DATA                                                  !2
   31    13      > JMP                                                      ->4
         14    >   FE_FREE                                                  $7
   36    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.62 ms | 997 KiB | 14 Q