php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19073 isset returning false positives
Submitted: 2002-08-23 11:19 UTC Modified: 2002-08-23 11:20 UTC
From: tim at thelogichouse dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: 4.2.2 OS: Red Hat Linux 7.2
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tim at thelogichouse dot com
New email:
PHP Version: OS:

 

 [2002-08-23 11:19 UTC] tim at thelogichouse dot com
 $x = "";

 if (isset($x))
    print "X is set\n";

 if (isset($y));
    print "Y is set\n";

 if (strlen($x) > 0)
    print "X is set (SL)\n";

 if (strlen($y) > 0)
    print "Y is set (SL)\n";

###
The following script should at best print 'X is Set' because $x has been set to "". However This is my output:

X is set
Y is set

$y is nowhere defined in the script, yet isset returns it as set.

Please feel free to contact if you need any more info.

Timothy M. Crider

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-23 11:20 UTC] tim at thelogichouse dot com
The script was written incorrectly.
 [2002-09-23 22:36 UTC] geethanandh at yahoo dot com
hello
 Tis is not a bug, u had placed a semi-colon after the if staement, so print is not includeed in the if condition cheking, so it priints Y is set.

bye
geethanandh
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 06 02:01:27 2024 UTC