[Pugged] bad toad

David Champion ciapug@ciapug.org
Tue, 18 Mar 2003 11:15:33 -0600


It's been quiet on this list... so for your comic relief:

Lathrop caught a little bug in something I wrote a while back...

if ($firstday >= 5 and $NumOfDays = 31) {
     $rows = 6;
}

...oops. At the time I wrote it (2001), February showed the correct # of 
days. However, in 2002 and 2003, the first comparison evaluates as true, 
so the second one assigns the value of 31... oops.

I bet I'm not the only one that's been bitten by the "=" operator acting 
as an assignment in evaluations. It's especially fun when you're 
switching between several different languages, and most of them don't 
act like PHP.

-dc