Check whether the direct wrapping scope of a token is within a limited set of
acceptable tokens.

Used to check, for instance, if a T_CONST is a class constant.

@since 0.14.0

@param int   $stackPtr     The position in the stack of the token to verify.
@param array $valid_scopes Array of token types.
Keys should be the token types in string format
to allow for newer token types.
Value is irrelevant.

@return int|bool StackPtr to the scope if valid, false otherwise.