1$myArray = [];
2
3array_push($myArray, (object)[
4 'key1' => 'someValue',
5 'key2' => 'someValue2',
6 'key3' => 'someValue3',
7]);
8
9return $myArray;
1$myArr = [1, 2, 3, 4];
2
3array_push($myArr, 5, 8);
4print_r($myArr); // [1, 2, 3, 4, 5, 8]
5
6$myArr[] = -1;
7print_r($myArr); // [1, 2, 3, 4, 5, 8, -1]