#23097 [Opn->Bgs]: isset() function returns nothing

From: Date: Mon, 07 Apr 2003 19:00:51 +0000
Subject: #23097 [Opn->Bgs]: isset() function returns nothing
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37289@lists.php.net to get a copy of this message
ID: 23097 Updated by: pollita@php.net Reported By: alex at globaldesign dot ca -Status: Open +Status: Bogus Bug Type: Output Control Operating System: Win XP PHP Version: 4.3.0 New Comment: isset() returns one of two possible values 'true' or 'false'. Neither of these are quantities which can be clearly displayed by echo so PHP's loose type juggling turns 'false' into a blank string and 'true' into the number 1. (Who knows what Derick was thinking in Bug5760) Try: var_dump(isset($_SESSION["not_created_var"])); and you'll see more meaningful information. Previous Comments: ------------------------------------------------------------------------ [2003-04-07 12:12:37] alex at globaldesign dot ca The isset() function is not working properly with SESSION vars. The following code : <? session_start(); echo isset($_SESSION["not_created_var"]); ?> //Should return '0' Agreed ??? In my case it's returning nothing... I event tried it on my web-hosting server, that is supposed to be properly configured, and still I don't get a '0'. I read Bug #5760 answered by Derick telling that PHP4 returns ""(the empty string) if a var is not set or create, and that '0' is returned if it existed. How come I get a '1' instead ??? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23097&edit=1

« previous php.bugs (#37289) next »