 <p>You have just forgotten the <code>new</code> in this line</p> <pre><code>$someclass = someOtherClass(); </code></pre> <p>It should be </p> <pre><code>$someclass = new someOtherClass(); </code></pre> <p>Then everything works. Although this only applies to the second version of your question, not the first!</p>