Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9656 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41721 invoked by uid 1010); 4 May 2004 11:33:10 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 41403 invoked from network); 4 May 2004 11:33:07 -0000 Received: from unknown (HELO smtp2.actcom.co.il) (192.114.47.35) by pb1.pair.com with SMTP; 4 May 2004 11:33:07 -0000 Received: from actcom.net.il (line106-24.adsl.actcom.co.il [192.117.106.24]) by smtp2.actcom.co.il (8.12.8/8.12.8) with ESMTP id i44BX244008283; Tue, 4 May 2004 14:33:04 +0300 Message-ID: <40977FDE.7020208@actcom.net.il> Date: Tue, 04 May 2004 14:34:54 +0300 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040404 X-Accept-Language: en-gb, en-us, en, he, ru MIME-Version: 1.0 To: "Tumurbaatar S." CC: internals@lists.php.net References: <20040504052554.60192.qmail@pb1.pair.com> <40972E8D.5090804@actcom.net.il> In-Reply-To: <40972E8D.5090804@actcom.net.il> X-Enigmail-Version: 0.83.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] nested includes fails? From: ilya79@actcom.net.il (Ilya Sher) Ilya Sher wrote: > 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. >> > That seems to be the correct behaviour for > both PHP5 and PHP4. Really sorry for misleading. Should read "... for PHP4" and I assume for PHP5. > > A class should never be defined twice - but > that's the case when you include or execute > somehow else the code with class definition > (common.php) more than once. >