3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ( 47 => array ( '2019-02-24' => array ( 'AVA_Id' => 1, 'AVA_Status' => 'Open' ), '2019-02-25' => array ( 'AVA_Id' => 3, 'AVA_Status' => 'Open' ), '2019-02-28' => array ( 'AVA_Id' => 4, 'AVA_Status' => 'Close' ), ), 48 => array ( '2019-02-26' => array ( 'AVA_Id' => 2, 'AVA_Status' => 'Open' ) ) ); $dates = array ( 0 => '2019-02-24', 1 => '2019-02-25', 2 => '2019-02-26', 3 => '2019-02-27', 4 => '2019-02-28', 5 => '2019-03-01', 6 => '2019-03-02' ); foreach ($array as &$arr) { foreach ($dates as $date) { $out[$date] = $arr[$date] ?? array('AVA_Id' => 0, 'AVA_Status' => 'no'); } $arr = $out; } print_r($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/ENPQt
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array, !1 = $dates, !2 = $arr, !3 = $date, !4 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   30     1        ASSIGN                                                   !1, <array>
   39     2      > FE_RESET_RW                                      $7      !0, ->15
          3    > > FE_FETCH_RW                                              $7, !2, ->15
   40     4    > > FE_RESET_R                                       $8      !1, ->12
          5    > > FE_FETCH_R                                               $8, !3, ->12
   41     6    >   FETCH_DIM_IS                                     ~10     !2, !3
          7        COALESCE                                         ~11     ~10
          8        QM_ASSIGN                                        ~11     <array>
          9        ASSIGN_DIM                                               !4, !3
         10        OP_DATA                                                  ~11
   40    11      > JMP                                                      ->5
         12    >   FE_FREE                                                  $8
   43    13        ASSIGN                                                   !2, !4
   39    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $7
   45    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.01 ms | 1400 KiB | 15 Q