Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7954 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98951 invoked by uid 1010); 18 Feb 2004 14:44:37 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 98893 invoked from network); 18 Feb 2004 14:44:36 -0000 Received: from unknown (HELO is.magroup.ru) (213.33.179.242) by pb1.pair.com with SMTP; 18 Feb 2004 14:44:36 -0000 Received: from grp-dovgal.MEDIA-ARTS.RU ([192.168.3.226]) by is.magroup.ru with Microsoft SMTPSVC(5.0.2195.5329); Wed, 18 Feb 2004 17:44:09 +0300 Date: Wed, 18 Feb 2004 17:44:08 +0300 To: internals@lists.php.net Message-ID: <20040218174408.6bfc24ac.tony2001@phpclub.net> In-Reply-To: <20040218153910.72cd1a0e@localhost.localdomain> References: <20040218152756.1f958513@localhost.localdomain> <20040218153910.72cd1a0e@localhost.localdomain> X-Mailer: Sylpheed version 0.9.9cvs10 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 18 Feb 2004 14:44:09.0281 (UTC) FILETIME=[AA9BE310:01C3F62D] Subject: Re: [PHP-DEV] Re: HEAD, include(_once), bug in variable declaration From: tony2001@phpclub.net (Antony Dovgal) On Wed, 18 Feb 2004 15:39:10 +0100 Pierre-Alain Joye wrote: > On Wed, 18 Feb 2004 15:27:56 +0100 > paj@pearfr.org (Pierre-Alain Joye) wrote: > > > Hello, > > > > Having the scripts pasted below: > > > > include_once fails to declare the variable 'foo'. Replace include_once > > by include and it works. I got the same behavior using require and > > require_once. > > To be precised: it fails to declare the variable on the 2nd call. The > 1st call works. because it doesn't really include this file on the 2nd call. [quote] include_once() should be used in cases where the same file might be included and evaluated more than once during a particular execution of a script, and you want to be sure that it is included exactly once to avoid problems with function redefinitions, variable value reassignments, etc. [/quote] thus, this is expected behaviour. --- WBR, Antony Dovgal aka tony2001 tony2001@phpclub.net