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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Tue Oct 08 22:01:27 2024 UTC