title: Class methods returning NULL Variables
body: <p>I have a Class that is setting up an API to parse the DOM of an external website in order to populate somebody's profile with character data from a game. My problem is that every single variable associated with any class on this page is returning null. Why? Here is the code(s) that are relevant. I am not getting the ID in this manner, but I extracted the code to a temporary page to simplify the debugging.</p>
  
  <pre><code>$id = $_GET['id'];
  
  require_once '../bootstrap.php';
  $api = new GetCharacter($id,$db);
  $data = $api-&gt;output();
  </code></pre>
  
  <p>Bootstrap is just your usual run of the mill database connection and definition setup. Everything in there works okay and all variables are returning their correct results (ie, the $db variable has a valid connection - tested inline too.) If I echo or var_dump the results of every variable from bootstrap.php they are all correct.</p>
  
  <p>Here is GetCharacter (I have removed all the methods because my problem doesn't involve them):</p>
  
  <pre><code>class GetCharacter {
  
      private $api, $db, $html;
      public $data, $id;
  
      public function __constructor($id, $db) {
  
          $this-&gt;id = $id;
          $this-&gt;api = new GetAPI;
          $this-&gt;db = $db;
  
      }
  }
  </code></pre>
  
  <p>Now if I make a dummy function to return, var_dump, print_r $db, it's NULL. Same for $api and $id. What's going on? I feel like I must be missing something exceptionally obvious. I'm passing $id and $db into the class on construction via dependency injection and I've never not had it work in this manner. It's simply <strong>not working</strong> and I have no idea why. </p>
  
  <p>I have tried numerous things:</p>
  
  <ul>
  <li>Changed the $db to $this->db = new Database; instead, to see if there was a scoping issue with the injection. Still NULL.</li>
  <li>Made the $this->id defined inside the constructor and not via injection. It still returns NULL. Let me make it really clear what happened there. <strong>In the constructor I put $this->id = '123456' and the returned value was NULL.</strong> - WTF?</li>
  <li>Used global $id (I don't WANT to, but desperate times...) and still NULL.</li>
  </ul>
  
  <p>I then made a dummy function:</p>
  
  <pre><code>public function WTF() {
  
      return 'WHAT THE HELL IS GOING ON';
  }
  </code></pre>
  
  <p>When I call this in the page with echo $api->WTF() nothing happens. For all intents and purposes, it seems like my Class is undefined but it's not, because otherwise it wouldn't even return NULL on var_dump. I'm also getting zero errors with error_reporting(-1) set.</p>
  
  <p>After nearly two hours of trying to debug this I'm utterly stumped.</p>