php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39294 "Fatal error: Cannot redeclare class" for classes that use extends
Submitted: 2006-10-28 23:39 UTC Modified: 2006-10-29 00:02 UTC
From: a79315 at hotmail dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.1.2 OS: suse 10.1
Private report: No CVE-ID:
 [2006-10-28 23:39 UTC] a79315 at hotmail dot com

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-28 23:46 UTC] a79315 at hotmail dot com
Should read: If
the "extends CTest3" is removed from file test2.inc there is no error.
 [2006-10-29 00:02 UTC] tony2001@php.net
>if (defined("CTEST2")) return;
>define("CTEST2", 1);

Classes are declared at compile time, while 'if() return;' is executed at runtime, so this is 100% expected behaviour.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 10:02:06 2014 UTC