Bug #51686 [Opn->Bgs]: Problem with global scoping
| From: | degeberg@php.net | Date: | Wed, 28 Apr 2010 18:20:47 +0000 |
| Subject: | Bug #51686 [Opn->Bgs]: Problem with global scoping | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-150007@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51686&edit=1
ID: 51686
Updated by: degeberg@php.net
Reported by: quaspam at yahoo dot com
Summary: Problem with global scoping
-Status: Open
+Status: Bogus
Type: Bug
Package: Scripting Engine problem
Operating System: Windows
PHP Version: 5.3.2
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2010-04-28 20:17:47] quaspam at yahoo dot com
Description:
------------
I had trouble running the following using php 5.3.2:
<?php
$username = 'dummy value';
function fetchUsername(){
global $username;
//Imitate retrieval
$username ='Sample Value';
}
fetchUsername();
echo $username;
?>
The above printed the dummy value (dummy value). Am i missing something?
Pliz help
Test script:
---------------
<?php
$username = 'dummy value';
function fetchUsername(){
global $username;
//Imitate retrieval
$username ='Sample Value';
}
fetchUsername();
echo $username; //Prints 'dummy value'
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51686&edit=1