|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-08-30 11:08 UTC] zeev at cvs dot php dot net
[2002-02-19 05:34 UTC] hvalette at free dot fr
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
It may be just "feature", but it is not documented to behave so: If I include file within a function and that file declares global variables, they are not really global: file t1.php: <? $T=1; function Test() { global $T; echo "T=$T\n"; } Test() ?> file t2.php: <? function Test2() { include('t1.php'); } Test2(); ?> 'php t1.php' gives T=1 'php t2.php' gives T= it is (unset). If I define T global in Test2(), it works - but it requires Test2 to know which global variables (configuration etc...) Test() uses... Michal Kara alias lemming