Question: According to the [Facebook docs](https://developers.facebook.com/docs/technical-guides/opengraph/publishing-with-app-token/), using `App_access_token` is as simple as:

```
$appid = 'xxx';
$secret = 'yyyyyyyyy';
$facebook = new Facebook(array(
  'appId'  => $appid,
  'secret' => $secret,
  'cookie' => true,
));

$session = $facebook->getUser()>0;
if($session){
  $access_token = 'access_token='.$facebook->getAccessToken();
  $app_access_token = file_get_contents("https://graph.facebook.com/oauth/access_token?client_id=$appid&client_secret=$secret&grant_type=client_credentials");
}

```

My problem is that `$access_token` is fine **but** `$app_access_token` **always returns false**, what am I doing wrong?

-EDIT-

If I open the `app_access_token` URL in my browser I can see the access token! It seems to fail the file\_get\_contents... ?

Answer: 
When a pointer to a function is taken, the compiler will generate an out-of-line body for the function. It is still possible to inline the function at other call sites.

Note that a function marked `inline` must have a definition available in all TUs which refer to it, and these definitions must be identical. Which means it's perfectly safe to inline the function at some call sites and keep it out-of-line at others.
Not only does the compiler inline "other calls of the function", but it may even inline calls through function pointers if it understands enough about which function is actually being used, something like this:

```
typedef void (*funcptr)();

void somefunc()
{
   ... do stuff here ... 
}

void indirection(funcptr *f)
{
   f();
}

void call_with_ptr()
{
    funcptr f = somefunc();
    for(int i = 0; i < 100; i++)
    {
       indirection(f);
    }
}

```

I had code similar to this, and it inlined the indirection, and made the call to somefunc() a direct call without using the function pointer. 

But of course, this assumes the compiler can figure out which function is called from the code - which is obvious in this case, but if there is runtime decisions involved, it may not do so.