|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-07-07 09:17 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
Description: ------------ When you create a normal class you can call it before the class is defined on the page. However, when you extend a class you cannot instantiate the class before it is declared. It will not be found. Reproduce code: --------------- <?php require_once('controller.php'); $l = new Login(); class Login extends Controller { function __construct() { parent::__construct(); echo('Extended'); } } ?> Expected result: ---------------- Extended Actual result: -------------- Fatal error: Class 'Login' not found in ...\test.php on line 4