Bug #17766: Variable doesnt Exist if the value of the Variable is Zero
| From: | dmdeathmaker at aol dot com | Date: | Fri, 14 Jun 2002 21:50:15 +0000 |
| Subject: | Bug #17766: Variable doesnt Exist if the value of the Variable is Zero | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-10479@lists.php.net to get a copy of this message | ||
From: dmdeathmaker@aol.com
Operating system: Win9x
PHP version: 4.2.1
PHP Bug Type: Variables related
Bug description: Variable doesnt Exist if the value of the Variable is Zero
hi,
anyone i know who trys to test a variable do it this way:
for Example a URL-Submitted value:
(http://localhost/somephp.php?variable=0 dont works)
(http://localhost/somephp.php?variable=1 works)
(http://localhost/somephp.php?variable=2 works)
Global $variable;
if ($variable)
{
echo "Variable Exist";
} else { echo "Variable dont Exist"; }
You perhaps use it too ...
the problem is :) if the variable is value anythings
fine til the point the variable-value ist zero ... thats
the point the variable exist nomore ...
only way to proof the existens is
if (strlen($variable)!=0) echo "variable exist";
i think thats a bug ....
MfG Cybergen, Member of the Softeis Hacker Crew
PS: I think thats a generally problem
--
Edit bug report at http://bugs.php.net/?id=17766&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17766&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17766&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17766&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17766&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17766&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17766&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17766&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17766&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17766&r=globals