Class not found after extending another class
<p>I have a file called Login.php which gives me the following error:</p>

<pre><code>Fatal error: Class 'Login' not found
</code></pre>

<p>The file structure is as follows:</p>

<pre><code>require_once('includes/Config.php');
require_once('includes/Initialize.php');
require_once('includes/Database.php');
require_once('includes/Cookie.php');

$database = new Database();
$login = new Login($database);

?&gt;

&lt;!-- Start of HTML SECTION COMES HERE --&gt;

&lt;form action="Login.php" method="POST"&gt;
    &lt;input type="text" name="Username" /&gt;
    &lt;input type="text" name="Password" /&gt;
    &lt;input type="submit" value="Submit" /&gt;
&lt;/form&gt;

&lt;!-- End of HTML SECTION COMES HERE --&gt;

&lt;?php
require_once('includes/Config.php');

class Login extends Config{

function __construct(){
    //Construct function handles the forms
}
</code></pre>

<p>Now, as known, when you use a class, function, variable or any other name reference in a programming language, you must first DECLARE IT.
The thing is, the code, as it is, without the extension:</p>

<pre><code>class Login{

function __construct(){
    //Construct function handles the forms
}
</code></pre>

<p><strong>Works perfectly.</strong></p>

<p><strong>Just after adding the extension,</strong> as mentioned above, the problem occurs.
I have a few other classes using the same method, AND extending the Config class, without returning any error.</p>

<p>Any ideas what happens here differently?</p>

<p>By the way, do you think that structure is preferred?</p>

<p>The issue if being mentioned in many threads, and on stackoverflow too, but as I saw until now, some saying it's some sort of a bug, but no real solution is being showed up, and it's been said about much earlier versions oh PHP.</p>