#33928 [Bgs]: I can broke 'GLOBALS'

From: Date: Mon, 01 Aug 2005 07:49:03 +0000
Subject: #33928 [Bgs]: I can broke 'GLOBALS'
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-82750@lists.php.net to get a copy of this message
ID: 33928 Updated by: tony2001@php.net Reported By: bolk at hitv dot ru Status: Bogus Bug Type: Unknown/Other Function Operating System: Linux Fedora Core 4 PHP Version: 5.0.4 New Comment: You can do any stupid thing you want, but this is not PHP problem. Previous Comments: ------------------------------------------------------------------------ [2005-07-30 20:38:10] bolk at hitv dot ru new PHP motto: it isn't a bug 'coz no one needs it working right anyways ------------------------------------------------------------------------ [2005-07-30 15:12:43] sniper@php.net I can also shoot myself in my leg but I don't do that since it would be stupid.. ------------------------------------------------------------------------ [2005-07-30 10:44:49] bolk at hitv dot ru But this example prints full GLOBALS: <? $a = array_merge(array(), $GLOBALS); $a['GLOBALS'] = 2; $GLOBALS = $a; print_r($GLOBALS['GLOBALS']); ?> There is an inconsistency between the two behaviours ------------------------------------------------------------------------ [2005-07-30 10:16:26] bolk at hitv dot ru Description: ------------ I can broke 'GLOBALS' array and 'GLOBALS' items doesn't equal 'GLOBALS' var. Reproduce code: --------------- <? $a = unserialize(serialize($GLOBALS)); $a['GLOBALS'] = 2; $GLOBALS = $a; print_r($GLOBALS['GLOBALS']); ?> Expected result: ---------------- Array ( [GLOBALS] => Array *RECURSION* et cetera Actual result: -------------- 2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33928&edit=1

« previous php.bugs (#82750) next »