I did change the function to simpler type:
and it works!
Code:
static function getCurrentUserID()
{
$current_user=ctrl_users::GetUserDetail() ;
return $current_user["userid"];
}