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
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to