I am obtaining the following error inside a Joomla model file:

unpredicted T_VARIABLE, expecting T_FUNCTION in /var/www/html/clientFiles/components/com_arrcard/models/buynow.php online 13

Here's the start of the file, up through line 14:

<?php

defined( '_JEXEC' ) or die( 'Restricted access' );

 jimport('joomla.application.component.model');

class ArrcardModelBuynow extends JModel
{
    public $failedFields = array();
    public $certificateNumber, $emailAddr, $voucherID, $voucherNbr, $userAcctID;

    //check if user is logged in
        $user =& JFactory::getUser();
        $userAcctID = $user->id;

Does anybody know why the getUser lines are leading to problems? I have used that code in many other areas without any errors.

Because the error states, this code:

//check if user is logged in
$user =& JFactory::getUser();
$userAcctID = $user->id;

should be in the function. Directly within the class, you are able to only declare member variables. $user does not even appear to become defined somewhere.