note 26046 deleted from language.variables.scope by danbrown
| From: | danbrown@php.net | Date: | Mon, 18 May 2009 01:42:39 +0000 |
| Subject: | note 26046 deleted from language.variables.scope by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155581@lists.php.net to get a copy of this message | ||
Note Submitter: mu at despammed dot com
----
morthanpurpl: You don't have to initialize variables you use first inside a variable, at least
not in PHP4.2.2. The following will just work fine and output "iam":
<?php
function dumdum()
{
global $a;
$a = "iam";
}
dumdum();
echo $a;
?>