php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23097 isset() function returns nothing
Submitted: 2003-04-07 12:12 UTC Modified: 2003-04-07 14:00 UTC
From: alex at globaldesign dot ca Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.3.0 OS: Win XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alex at globaldesign dot ca
New email:
PHP Version: OS:

 

 [2003-04-07 12:12 UTC] 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 ???

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-07 14:00 UTC] pollita@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 21:01:33 2024 UTC