Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19613 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21504 invoked by uid 1010); 14 Oct 2005 08:09:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 21489 invoked from network); 14 Oct 2005 08:09:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2005 08:09:36 -0000 X-Host-Fingerprint: 217.8.241.112 ns1.synchromedia.co.uk OpenBSD 3.0-3.4 Received: from ([217.8.241.112:6086] helo=ns1.synchromedia.co.uk) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 1D/4E-04211-FB76F434 for ; Fri, 14 Oct 2005 04:09:36 -0400 Received: (qmail 23972 invoked by uid 89); 14 Oct 2005 08:09:32 -0000 Received: from unknown (HELO ?10.0.0.1?) (marcus@synchromedia.co.uk@87.74.30.27) by mail.synchromedia.co.uk with SMTP; 14 Oct 2005 08:09:32 -0000 Mime-Version: 1.0 (Apple Message framework v734) In-Reply-To: <31.67.04211.D0B4F434@pb1.pair.com> References: <2794B48D-7B1B-41AC-B9DA-04210699BD14@synchromedia.co.uk> <31.67.04211.D0B4F434@pb1.pair.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: Content-Transfer-Encoding: 7bit Date: Fri, 14 Oct 2005 09:09:30 +0100 To: PHP Internals Internals X-Mailer: Apple Mail (2.734) Subject: Re: [PHP-DEV] Re: Globals unavailable, require oddity From: marcus@synchromedia.co.uk (Marcus Bointon) On 14 Oct 2005, at 07:07, Unknown W. Brackets wrote: > If you include a file within a function, that file will be loaded > in that function's scope. Example: > The same happens if b.class.php is included within a function (or > class member, etc.) and includes a.inc.php, as in your example (I > am presuming.) > > If this is the problem, I suggest simply adding: > > global $a; > > At the top of a.inc.php, which will solve the problem for you. I'm aware of how it's supposed to work, but the problem is that it's doing something very screwy for me and not working like it should. Because it's so different to how it normally works, I can only conclude that it's a php.ini problem (though I can't think what setting would cause this) or a bug. I can work around it by declaring it as a global in the inc file, but my point is that it should not be necessary - something odd is going on that's peculiar to my setup. Given that no-one else can reproduce it, I'll just have to persevere. Thanks for looking anyway, Marcus -- Marcus Bointon Synchromedia Limited: Putting you in the picture marcus@synchromedia.co.uk | http://www.synchromedia.co.uk