a reddit-php-sdk method not outputting anything
- by diggpthoo
I'm trying to learn reddit code and using this https://github.com/jcleblanc/reddit-php-sdk
There's a method in this library $reddit->getUser() which outputs null always. Everything else seems to be working though.
include_once("jcleblanc-reddit-php-sdk-4a4cc32/reddit.php");
$reddit = new reddit("my-username", "my-password");
$userData = $reddit->getUser();
var_dump($userData);
outputs null.
$response = $reddit->getListing("all", 5);
var_dump($response);
outputs what's expected just fine. Then what could be going wrong with $reddit->getUser()?