Problem assigning by reference [closed]

The issue is that you’re attempting to store output of a method by reference to $starredgroup_products, which is not possible.

This should fix it (untested):

$starredgroup          = $myPage->getGroup( $starredgroup );
$starredgroup_id       = $starredgroup['groupid']; 
$starredgroup_products = $myPage->getStarredProducts( $starredgroup_id );