php constructor not getting called? or something?
<p>When TestPage.php is run in browser, 'trying to create new obj...' is echo'd, but nothing else. Is the constructor not getting called?</p>

<p>This isn't the full code for either class, but hopefully it's enough for someone to tell me where I'm going wrong...</p>

<p>TestPage.php</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/plain; charset=UTF-8"&gt;
        &lt;title&gt;&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;?php
        class MyClass {
        $api_key = 'somestring';
        $username = 'username';
        echo 'trying to create new obj...';
        $myObj = new MyClass($api_key, $username);
        echo 'new obj created...';

    ...
        ?&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>MyClass.class.php</p>

<pre><code>&lt;?php
class MyClass {
    protected $_api_key;
    protected $_username;


    public function __construct($api_key, $username) {
        echo 'entered constructor...';
        $this-&gt;_api_key = $api_key;
        $this-&gt;_username = $username;
        echo 'leaving constructor...';
    }

    ...
}
?&gt;
</code></pre>
