|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-04-28 20:20 UTC] degeberg@php.net
-Status: Open
+Status: Bogus
[2010-04-28 20:20 UTC] degeberg@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 08 22:00:01 2025 UTC |
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' ?>