Its better to not use array_push and just use what you suggested. The functions just add overhead.
//dont need to define the array, but in many cases its the best solution.
$cart = array();
//automatic new integer key higher then the highest existing integer
//key in the array, starts at 0
$cart[] = 13;
$cart[] = 'text';
//numeric key
$cart[4] = $object;
//text key (assoc)
$cart['key'] = 'test';