如何解析这个对象

I have this reponse from using a client library to make a oauth connection to twitter

OAuth\OAuth1\Token\StdOAuth1Token Object
(
    [requestToken:protected] => aaa
    [requestTokenSecret:protected] => bbb
    [accessTokenSecret:protected] => ccc
    [accessToken:protected] => ddd
    [refreshToken:protected] => eee
    [endOfLife:protected] => -9002
    [extraParams:protected] => Array
        (
            [user_id] => 123
            [screen_name] => 456
        )

)

How do I get the values from the object?

I've tried $token->{'requestToken:protected'} which returns an error and casting the response to an array, but end up with

Array
(
    [*requestToken] => aaa

)

Either your StdOAuth1Token Object exposes getters, in which case you can directly use them, or you need to do some wrapping

class MyStdOAuth1Token extends StdOAuth1Token {
  public function getRequestToken() { return $this->requestToken; }
  public function getRequestTokenSecret() { return $this->requestTokenSecret; }
  // ...
}

now cast your object to the wrapper class and use the just-written getters.