|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2000-05-26 18:42 UTC] joey at cvs dot php dot net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 21:00:02 2025 UTC | 
<?php function change() { global $var; unset($var); $var = 'after'; } $var = 'before'; change(); print $var . "<br>\n"; ?> PHP3 prints "after", but PHP4 prints "before". If the line "unset($var);" in the function is removed, both print "after". Looks like `unset' is removing the effect of the `global'.