Can't create Access Token with code

On execution, the value $oauth = null if i print or var_dump it