#23365 [Opn->Bgs]: global twice causes problems

From: Date: Sat, 26 Apr 2003 20:51:14 +0000
Subject: #23365 [Opn->Bgs]: global twice causes problems
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38469@lists.php.net to get a copy of this message
ID: 23365 Updated by: pollita@php.net Reported By: spagmoid at yahoo dot com -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: WinXP PHP Version: 4.3.1 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2003-04-26 15:35:04] 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? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23365&edit=1

« previous php.bugs (#38469) next »