Bug #51840 [Opn->Bgs]: definitions of global varaibles not working properly
| From: | johannes@php.net | Date: | Mon, 17 May 2010 14:56:23 +0000 |
| Subject: | Bug #51840 [Opn->Bgs]: definitions of global varaibles not working properly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-150513@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51840&edit=1
ID: 51840
Updated by: johannes@php.net
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