Lazy load class in PHP
<p>I want to lazy load class but with no success</p>

<pre><code>&lt;?php

class Employee{

    function __autoload($class){

        require_once($class);
    }


    function display(){

        $obj = new employeeModel();
        $obj-&gt;printSomthing();
    }
}
</code></pre>

<p>Now when I make this </p>

<pre><code>function display(){
            require_once('emplpyeeModel.php');
            $obj = new employeeModel();
            $obj-&gt;printSomthing();
        }
</code></pre>

<p>It works but I want to lazy load the class.</p>
