Edit report at http://bugs.php.net/bug.php?id=51686&edit=1

 ID:               51686
 Updated by:       degeb...@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

Reply via email to