PHP中的多维数组 - 添加额外的维度?

$counter = 0;
foreach($dates as $dbRow) :
$datesExp[] = [$counter => array($dbRow->e_id => new DateTime($dbRow->l_date_expect))];
++$counter;
endforeach;

Using the above code, I'm trying to achieve is an array in format of:

0 => array(
    PK => DATE)
1 => array(
    PK2 => DATE2)
....etc

But what i'm getting with a var_dump is:

array (size=3)
    0 => 
    array (size=1)
      0 => 
        array (size=1)
          2 => 
            object(DateTime)[7]

Where is this: array (size=1) 0=> intermediate dimension coming from?

From here: $datesExp[] = [$counter => array($dbRow->e_id => new DateTime($dbRow->l_date_expect))];

$datesExp[] = = add the following as an entry in this array

[...]; = everything in here is an array

array($dbRow->e_id => new DateTime($dbRow->l_date_expect)) = the innermost array

should be

$datesExp[$counter] = array($dbRow->e_id => new DateTime($dbRow->l_date_expect));

try this ,no need of seperate counter,no need of outside braces [..]

$datesExp[] = array($dbRow->e_id => new DateTime($dbRow->l_date_expect));