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

2005-08-01 Thread tony2001
 ID:   33928
 Updated by:   [EMAIL PROTECTED]
 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] [EMAIL PROTECTED]

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=33928edit=1


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

2005-07-30 Thread bolk at hitv dot ru
 ID:   33928
 User updated by:  bolk at hitv dot ru
 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:

new PHP motto: it isn't a bug 'coz no one needs it working right
anyways


Previous Comments:


[2005-07-30 15:12:43] [EMAIL PROTECTED]

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=33928edit=1