|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-04-26 15:35 UTC] spagmoid at yahoo dot com
If you declare a variable global twice, it gives you garbage the second time. IE: global $Bob; global $Bob; This was already reported, and sniper shot it down. That's what he does apparently, shoots down valid bugs in the goal of keeping PHP as buggy as possible! Maybe he works for Micro$oft? PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 08:00:01 2025 UTC |
Or, perhaps sniper bogusified it because it's bogus. Let's leave out for the moment the sheer wrongness of globalizing a variable twice in a row. That's not even at issue at the moment. What you descibe simply doesn't occur (in PHP4 or PHP5). It may be that there are special circumstances causing it to happen in your script but since you failed to follow the instructions on how to report a bug I'm simply writting my own script to test it. <?php function foo() { global $bar; global $bar; echo $bar; } $bar = "baz"; foo(); ?> Outputs "baz" as expected. If you decide to submit a proper bug report (with the minimally necessary information), please do so by reopening this bug with the updated information. NOT by creating a new bug. (Again, following instructions is a good thing) Oh, and on a personal note, insulting someone is not the best way to illicit their help.