Home  >  Article  >  Backend Development  >  Oauth2 related issues

Oauth2 related issues

WBOY
WBOYOriginal
2016-08-30 09:36:44895browse

Oauth2 related issues

Although I know that Oauth2::getMyopenid() is a method to obtain the user's openid, I would like to ask if getMyopenid() is a fixed usage?
Also, is the "::" double colon a fixed way of writing or does it have other meanings? Want to know what is happening and why. Thank you for your trouble.

Reply content:

Oauth2 related issues

Although I know that Oauth2::getMyopenid() is a method to obtain the user's openid, I would like to ask if getMyopenid() is a fixed usage?
Also, is the "::" double colon a fixed way of writing or does it have other meanings? Want to know what is happening and why. Thank you for your trouble.

  • getMyopenid() is a method name, a method name in the Oauth2 class. You can understand it as a fixed usage. It can be processed according to the different parameters you pass in and return to you the corresponding openid

  • The double colon means that this is a static method and needs to be used like this. If it is not static, use -> the arrow points to it

The scope resolution operator (also known as Paamayim Nekudotayim) or more simply a pair of colons can be used to access static members, class constants, and can also be used to override properties and methods in a class.

Nothing is better than the official explanation
http://php.net/manual/zh/lang...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn