#27128 [Opn->Bgs]: session_unset()

From: Date: Tue, 03 Feb 2004 13:27:05 +0000
Subject: #27128 [Opn->Bgs]: session_unset()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-54315@lists.php.net to get a copy of this message
ID: 27128 Updated by: sniper@php.net Reported By: dizit at mail dot ru -Status: Open +Status: Bogus Bug Type: Session related Operating System: Win XP PHP Version: 4.3.4 New Comment: The behaviour is correct. (and hasn't changed since 4.2.2, the output of the script is exactly same with 4.2.2 and 4.3.4) Previous Comments: ------------------------------------------------------------------------ [2004-02-03 05:57:17] dizit at mail dot ru Description: ------------ Run script below and see next: BEGIN___________________________________________________ set var=56 session_register("var") var=56 $GLOBALS["var"] - 56 session_unset() ATENTION----> var=56 ATENTION----> $GLOBALS["var"] - and gettype($GLOBALS["var"]) is NULL session_register("another") ATENTION----> var="another" ___________________________________________________END If run the script in the Zend Develoment Env. 3.02 Plus and see next result: BEGIN____________________________________________________ set var=56 session_register("var") var=56 $GLOBALS["var"] - 56 session_unset() var=56 $GLOBALS["var"] = 56 and gettype($GLOBALS["var"]) is integer session_register("another") var=56 ____________________________________________________END Win XP Apache 1.3.26 php 4.3.2 and 4.3.4 php.ini register_globals = On Reproduce code: --------------- <? session_start(); $var=56; echo '<p>set var=56'; session_register('var'); echo '<p>session_register("var")'; echo '<p>echo var='.$var; echo '<p>echo $GLOBALS["var"] - '.@$GLOBALS['var']; session_unset();echo '<p>session_unset()'; echo '<p>echo var='.$var; echo '<p>echo $GLOBALS["var"] - '.@$GLOBALS['var'].' and gettype($GLOBALS["var"]) is '.gettype(@$GLOBALS['var']); session_register('another'); echo '<p>session_register("another")'; echo '<p>Once more echo var='.$var; session_destroy(); ?> Expected result: ---------------- run on PHP Version 4.2.2 and see: set var=56 session_register("var") var=56 $GLOBALS["var"] - 56 session_unset() var=NULL $GLOBALS["var"] = NULL session_register("another") var=NULL ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27128&edit=1

« previous php.bugs (#54315) next »