Skip to content

Comment on JavaScript: what is "this"?parent

Comments

global $a in PHP is just another way to write $a =& $GLOBALS['a'];

I.e. you just create reference to a global variable. Unsetting reference just breaks the tie between variable name and content.

Exactly, which means that unset( $a ) is not the same thing as unset( $GLOBALS['a'] ). It makes perfect sense, just not a kind of thing you might not expect at first.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.