this comes when i try to open the php files. Don't know what happen

here is my code:

function verifyAlphaNum ($teststring) {
    return (eregi ("^([[:alnum:]]| - |\.| |')+$", $teststring));
    }

$valid = verifyAlphaNum ($username)
    if (!$valid){ <<<<<<<<<<<<<< here come the error
        $error_msg[] ="Username must be letters and number";
        }

thx