#19073 [Com]: isset returning false positives

From: Date: Tue, 24 Sep 2002 03:36:27 +0000
Subject: #19073 [Com]: isset returning false positives
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-20158@lists.php.net to get a copy of this message
ID: 19073 Comment by: geethanandh@yahoo.com Reported By: tim@thelogichouse.com Status: Bogus Bug Type: Variables related Operating System: Red Hat Linux 7.2 PHP Version: 4.2.2 New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2002-08-23 11:20:14] tim@thelogichouse.com The script was written incorrectly. ------------------------------------------------------------------------ [2002-08-23 11:19:06] tim@thelogichouse.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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19073&edit=1

« previous php.bugs (#20158) next »