Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9646 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99126 invoked by uid 1010); 4 May 2004 05:43:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 99091 invoked from network); 4 May 2004 05:43:03 -0000 Received: from unknown (HELO BLR-DSMASTER.BLR.NOVELL.COM) (164.99.147.9) by pb1.pair.com with SMTP; 4 May 2004 05:43:03 -0000 Received: from linux.blr.novell.com [164.99.145.41] by BLR-DSMASTER.BLR.NOVELL.COM; Tue, 04 May 2004 11:12:57 +0530 Reply-To: kameshj@fastmail.fm To: "Tumurbaatar S." Cc: internals@lists.php.net In-Reply-To: <20040504052554.60192.qmail@pb1.pair.com> References: <20040504052554.60192.qmail@pb1.pair.com> Content-Type: text/plain Message-ID: <1083649378.20045.3.camel@linux.local> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Tue, 04 May 2004 11:12:59 +0530 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] nested includes fails? From: kameshj@fastmail.fm (Kamesh Jayachandran) Hi, It does not seem to happen in Linux. I had similar issue with Netware. The issue was with my script. The issue can be, In A.php you might have require_once("common.php"); In A.php you might have require_once("Common.Php"); For windows file system 'common.php', 'Common.php', 'CoMmOn.PhP' and all such combinations are same. But for PHP each one are different so it would try to load many times and hence the fatal error. With regards Kamesh Jayachandran On Tue, 2004-05-04 at 10:55, Tumurbaatar S. wrote: > 'common.php' contains some class definition and PHP5 fails with > 'PHP Fatal error: Cannot redeclare class ... in common.php...' when > script C.php starts. The file including map is: > > A.php: require_once(common.php) > B.php: require_once(common.php) > C.php: > require_once(A.php) > require_once(B.php) > > That is bug? When only one file is included (A or B), > the contents of 'common.php' is available, i.e. nested require > works. Only fails when nested and multiple require. > > P.S. I use PHP5 RC2 running as CGI on WinXP/IIS.