3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace OAuth2\Storage { /** * Implement this interface to specify where the OAuth2 Server * should get/save authorization codes for the "Authorization Code" * grant type * * @author Brent Shaffer <bshafs at gmail dot com> */ interface AuthorizationCodeInterface { /** * The Authorization Code grant type supports a response type of "code". * * @var string * @see http://tools.ietf.org/html/rfc6749#section-1.4.1 * @see http://tools.ietf.org/html/rfc6749#section-4.2 */ const RESPONSE_TYPE_CODE = "code"; /** * Fetch authorization code data (probably the most common grant type). * * Retrieve the stored data for the given authorization code. * * Required for OAuth2::GRANT_TYPE_AUTH_CODE. * * @param $code * Authorization code to be check with. * * @return * An associative array as below, and NULL if the code is invalid * @code * return array( * "client_id" => CLIENT_ID, // REQUIRED Stored client identifier * "user_id" => USER_ID, // REQUIRED Stored user identifier * "expires" => EXPIRES, // REQUIRED Stored expiration in unix timestamp * "redirect_uri" => REDIRECT_URI, // REQUIRED Stored redirect URI * "scope" => SCOPE, // OPTIONAL Stored scope values in space-separated string * ); * @endcode * * @see http://tools.ietf.org/html/rfc6749#section-4.1 * * @ingroup oauth2_section_4 */ public function getAuthorizationCode($code); /** * Take the provided authorization code values and store them somewhere. * * This function should be the storage counterpart to getAuthCode(). * * If storage fails for some reason, we're not currently checking for * any sort of success/failure, so you should bail out of the script * and provide a descriptive fail message. * * Required for OAuth2::GRANT_TYPE_AUTH_CODE. * * @param string $code Authorization code to be stored. * @param mixed $client_id Client identifier to be stored. * @param mixed $user_id User identifier to be stored. * @param string $redirect_uri Redirect URI(s) to be stored in a space-separated string. * @param int $expires Expiration to be stored as a Unix timestamp. * @param string $scope OPTIONAL Scopes to be stored in space-separated string. * * @ingroup oauth2_section_4 */ public function setAuthorizationCode($code, $client_id, $user_id, $redirect_uri, $expires, $scope = null); /** * once an Authorization Code is used, it must be exipired * * @see http://tools.ietf.org/html/rfc6749#section-4.1.2 * * The client MUST NOT use the authorization code * more than once. If an authorization code is used more than * once, the authorization server MUST deny the request and SHOULD * revoke (when possible) all tokens previously issued based on * that authorization code * */ public function expireAuthorizationCode($code); } } namespace OAuth2\OpenID\Storage { use OAuth2\Storage\AuthorizationCodeInterface as BaseAuthorizationCodeInterface; /** * Implement this interface to specify where the OAuth2 Server * should get/save authorization codes for the "Authorization Code" * grant type * * @author Brent Shaffer <bshafs at gmail dot com> */ interface AuthorizationCodeInterface extends BaseAuthorizationCodeInterface { /** * Take the provided authorization code values and store them somewhere. * * This function should be the storage counterpart to getAuthCode(). * * If storage fails for some reason, we're not currently checking for * any sort of success/failure, so you should bail out of the script * and provide a descriptive fail message. * * Required for OAuth2::GRANT_TYPE_AUTH_CODE. * * @param $code authorization code to be stored. * @param $client_id client identifier to be stored. * @param $user_id user identifier to be stored. * @param string $redirect_uri redirect URI(s) to be stored in a space-separated string. * @param int $expires expiration to be stored as a Unix timestamp. * @param string $scope OPTIONAL scopes to be stored in space-separated string. * @param string $id_token OPTIONAL the OpenID Connect id_token. * * @ingroup oauth2_section_4 public function setAuthorizationCode($code, $client_id, $user_id, $redirect_uri, $expires, $scope = null, $id_token = null); */ } }
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_STRING in /in/BgQjl on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING in /in/BgQjl on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/BgQjl on line 3
Process exited with code 255.

preferences:
247.02 ms | 401 KiB | 360 Q