How to make a multidimensional array with the samples?

I need to do tests and an example to all withdraw I figured that Celly better output an array of question and answers. The only objects I understand how to do, but with the array not. Or not array to use for this purpose?
Here is my implementation
public function actionTesting($id)
{
 $testArr = [];
 $model = Questions::find()->where(['id_theme' => $id])->all();
 foreach ($model as $key => $value){
 $testArr[] = ['id' => $value->id, 'text' => $value->name];
 $answear = Answers::find()->where(['id_question' => $value->id])->all();

 //for ($i = 0; $i<count($answear); $i++){ $testarr[$i]="array_push($testArr," $answear->name);
//}
}

 return $this->render('test', [
 'model' => $model,
 'testArr' => $testArr
]);
 }</count($answear);>

You get this array
array (size=3)
 0 => 
 array (size=2)
 'id' => int 1
 'text' => string 'Question zero' (length=79)
 1 => 
 array (size=2)
 'id' => int 2
 'text' => string 'first Question?' (length=64)
 2 => 
 array (size=2)
 'id' => int 4
 'text' => string '2' (length=134)

There should be approximately such structure
[key => [
'id' => id
'text' => text
'answear' => ['text' => text, 'answear' => answear]
]]
June 8th 19 at 16:57
0 answer

Find more questions by tags Yii