php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17766 Variable doesnt Exist if the value of the Variable is Zero
Submitted: 2002-06-14 17:50 UTC Modified: 2002-06-14 17:51 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: dmdeathmaker at aol dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: 4.2.1 OS: Win9x
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: dmdeathmaker at aol dot com
New email:
PHP Version: OS:

 

 [2002-06-14 17:50 UTC] dmdeathmaker at aol dot com
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-14 17:51 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC