Edit report at http://bugs.php.net/bug.php?id=51840&edit=1
ID: 51840 Updated by: [email protected] Reported by: christian dot gnoth at arcor dot de Summary: definitions of global varaibles not working properly -Status: Open +Status: Bogus Type: Bug Package: Variables related Operating System: Linux x86_64 PHP Version: 5.2.13 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Please re-read the chapter how scoping works in PHP. http://php.net/manual/en/language.variables.scope.php Previous Comments: ------------------------------------------------------------------------ [2010-05-17 16:51:28] christian dot gnoth at arcor dot de Description: ------------ hi, I would like to define few variables global so that I can use them in all functions - also if I include a php file with functions. actually I expect, that if I declare a variable outside the functions as global, that those variables are available inside the functions. Test script: --------------- global $var1; function funct1() { echo $var1; } include 'incl_file1'; incl_dile1: function funct2() { echo $var1; } Expected result: ---------------- should work without problem or notice that var1 is not defined... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51840&edit=1
