fix error in php code: token initialization functions used invalid scope