That sounds about right. It pretty much described the behavior between
the two versions.
Thanks for the info.
On Tue, 13 Jul 2004 18:44:06 -0500, Michael Sims
<[EMAIL PROTECTED]> wrote:
> Curt Zirzow wrote:
> > * Thus wrote Josh Close:
> >> if($var)
> >>
> >> used to work for
> >>
> >> if($var
That sounds about right. It pretty much described the behavior between
the two versions.
Thanks for the info.
On Tue, 13 Jul 2004 18:44:06 -0500, Michael Sims
<[EMAIL PROTECTED]> wrote:
> Curt Zirzow wrote:
> > * Thus wrote Josh Close:
> >> if($var)
> >>
> >> used to work for
> >>
> >> if($var !
Curt Zirzow wrote:
> * Thus wrote Josh Close:
>> 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)
>
> I still think this is unnecessary
>
> if ("0") { echo '"0"'; }
> if ("") {
* Thus wrote Josh Close:
> 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)
I still t
gt;
>
>
> -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 ch
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 (
I think I'll just have to typecast everything, that should always work then.
On Tue, 13 Jul 2004 15:47:40 -0400, Adam Bregenzer <[EMAIL PROTECTED]> wrote:
> On Tue, 2004-07-13 at 15:35, Josh Close wrote:
> > The problem is, if 0 gets changed to "0" somewhere throughout. That's
> > why I've alway
On Tue, 2004-07-13 at 15:35, Josh Close wrote:
> The problem is, if 0 gets changed to "0" somewhere throughout. That's
> why I've always used if($var) because it's usually not cared what the
> type is, but it seems to now.
You can typecast values as well, this may be a good way to achieve what
you
Josh Close wrote:
> $result = mssql_query($sql);
> $row = mssql_fetch_array($result);
> $var = $row[0];
>
> So it should be an int. And if it's copied into a function it
> shouldn't be changed.
>
> But doing
>
> if($var)
>
> doesn't seem to work after I upgraded versions. Which is making me
> think
On Tue, 13 Jul 2004 14:35:32 -0500, Josh Close <[EMAIL PROTECTED]> wrote:
> Well, the actual code is hard to tell. It's grabbed from a db so it
> should be an int. But it's also run through some functions. That's why
> I'd like a to tell what's going on better.
>
> The variable is always set. Basi
Well, the actual code is hard to tell. It's grabbed from a db so it
should be an int. But it's also run through some functions. That's why
I'd like a to tell what's going on better.
The variable is always set. Basically
$result = mssql_query($sql);
$row = mssql_fetch_array($result);
$var = $row[0
* Thus wrote Josh Close:
> 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 */ }
These values will all *not* do something:
var_dump((bool) 0);
var_dump((bool) array());
var_dump(
> 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
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 =
14 matches
Mail list logo