strange behaviour of unset()

From: Date: Mon, 08 Jul 2002 06:47:26 +0000
Subject: strange behaviour of unset()
Groups: php.general 
Request: Send a blank email to php-general+get-106036@lists.php.net to get a copy of this message
Hi everybody! I just switched from 4.0.6 to 4.2.1 (register_globals is ON) and I noticed that unset() is not working properly. Specifically, if I use "unset($a)" in a page, $a becomes not set in THAT page, but for the next pages (using sessions) $a gets back at its value. Here is the sample: page1: session_start(); session_register("a"); $a="toto"; echo $a; OUTPUT: toto page 2: session_start(); unset($a); echo $a; OUTPUT: (nothing) page 3: session_start(); echo $a; OUTPUT: toto Have I done anything wrong? Have the rules changed recently? The manual still reads: "unset() destroys the specified variables" Thanks! _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx

« previous php.general (#106036) next »