I'm positive that it will always be set, 'cause I set it. It's just going the comparison.
if($var) used to work for if($var != 0) or if($var != "0") but that doesn't seem to work since I upgrade. So I'm just going to do if((int)$var) from now on, 'cause that should always work. I'll typecast everything that being compared to and int to make sure. On Tue, 13 Jul 2004 14:01:47 -0700 (GMT-07:00), [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > http://marc.theaimsgroup.com/?l=php-general&m=108646344905178&w=2 > > > > > -----Original Message----- > From: Matthew Sims <[EMAIL PROTECTED]> > Sent: Jul 13, 2004 12:15 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] php 4.3.7/5.0 > > > I've noticed that in the last release of php 4.3.7 (or 5.0.0), that > > when checking the value of a variable has changed. > > > > ex: > > > > if($var){ /* do something */ } > > > > doesn't work anymore. I've had to change code to > > > > if($var > 0) > > > > but the problem is, what if $var was converted to $var = "0" instead > > of $var = 0 somewhere throughout the code that I didn't know about? > > > > Is there a way to be sure what's going on here? > > > > -- > > -Josh > > What about the isset function? Or any of the following: > > http://us3.php.net/manual/en/ref.var.php > > --Matthew Sims > --<http://killermookie.org> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- -Josh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php