From: darcy at 1000camels dot com Operating system: Linux, MacOSX PHP version: 4.3.8 PHP Bug Type: Scripting Engine problem Bug description: global variable not available when sourced by include()
Description: ------------ This is a somewhat complicated bug to demonstrate. i have placed files online so that the behaviour can be demonstrated. Essentially, the bug is that when you include a php script using include() with a relative url (not absolute), global variables used within a function in the sourced code are not available. this seems to occur only when the original include() is within a class or function. if it is in open code, it works find. it's a complex bug and i'm not sure the best way to analyze. Reproduce code: --------------- http://1000camels.com/phpBug/ four files (and their source): test-open-code.php - works test-within-class.php - does not work test-within-function.php - does not work testMod.php - code which is being sourced Expected result: ---------------- i expect the global variable to be available Actual result: -------------- the global variable (in my example $anObject and $aVariable) are not available. -- Edit bug report at http://bugs.php.net/?id=29562&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29562&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29562&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29562&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29562&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29562&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29562&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29562&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29562&r=support Expected behavior: http://bugs.php.net/fix.php?id=29562&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29562&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29562&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29562&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29562&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29562&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29562&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29562&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29562&r=float