Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

#29429 [Opn->Bgs]: unset( $GLOBALS['foo']); unset only global variable, not variables that REFERE
ID:               29429
Updated by:       tony2001@php.net
Reported By:      kingoleg at mail dot ru
-Status:           Open
+Status:           Bogus
Bug Type:         Documentation problem
Operating System: All
PHP Version:      4.3.8
New Comment:

Then it's a bogus docu problem.



Previous Comments:
------------------------------------------------------------------------

[2004-07-29 09:44:18] kingoleg at mail dot ru

Doc problem about this http://bugs.php.net/?id=29428 was closed with
bogus status :)

------------------------------------------------------------------------

[2004-07-29 09:23:59] tony2001@php.net

It's a docu problem, not a bug.

------------------------------------------------------------------------

[2004-07-28 15:05:56] kingoleg at mail dot ru

Description:
------------
unset( $GLOBALS['foo']); unset only global variable, not variables that
REFERED to global variable

How we can unset global variable with all referenced variable using
unset() function? Do we must user assign to null?

Reproduce code:
---------------
<?php
function a( &$foo) {
$foo = 'ok';
b( $foo);
var_dump( $foo);
}

function b( &$foo) {
$foo = 'not ok';
unset( $GLOBALS['foo']);
}

global $foo;
$foo = 'global';
a($foo);
var_dump( $foo);

?>

Expected result:
----------------
NULL NULL

Actual result:
--------------
string(6) "not ok" NULL


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=29429&edit=1

Report this thread to moderator Post Follow-up to this message
Old Post
tony2001@php.net
07-29-04 01:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Documentation archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:28 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.