|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-08 20:36 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 06:00:01 2025 UTC |
Description: ------------ This is kinda hard to explain, but here goes. I have this directory structure: / /htdocs /includes I have a file in /htdocs (index.php) which includes a file (base.class.php) in /includes which in turn includes another file (config.inc.php) in /includes. /includes is in my include_path and so I'm just using: require('file'); Now, the problem seems to be that the variable in config.inc.php (its just a single array of config options) is not visible in base.class.php unless I use a relative path (require('../includes/config.inc.php');) As I say there is no problem when using the relative path and no Fatal Error if I'm not, just the Notice. I haven't had time to come up with a test case (sorry) but if this is indeed a proper bug I felt you might like to fix it before 4.3.3 final is out. I can also confirm this behavior in a snap (4.3.x 200308050430) and 4.3.2 final. I will come up with a test case and also test on FBSD asap (next couple of days is my earliest) Note: there seems to be no problems when there is no nested inclusion involved (i.e. index.php requires footer.inc.php and can access its vars) - Davey Reproduce code: --------------- class base { function base() { require('config.inc.php'); $this->_CONFIG = $_CONFIG; } } Expected result: ---------------- $_CONFIG should be assigned to $this->config Actual result: -------------- Notice: Undefined variable: _CONFIG