Re: Found a PHP bug!!!!!!!!!
| From: | 1LT John W. Holmes | Date: | Mon, 27 Jan 2003 20:57:13 +0000 |
| Subject: | Re: Found a PHP bug!!!!!!!!! | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133295@lists.php.net to get a copy of this message | ||
Even doing a type cast won't make a difference for the original problem.
Even if you cast "08" to an integer and compare it to 08 (invalid octal
number), it'll still fail.
The original solution was the best, remove the leading zero from the
comparisons and let PHP handle the type casting.
---John Holmes...
----- Original Message -----
From: "Ray Hunter" <ray@php.net>
To: "Scott Fletcher" <scott@abcoa.com>
Cc: <php-general@lists.php.net>
Sent: Monday, January 27, 2003 3:45 PM
Subject: Re: [PHP] Found a PHP bug!!!!!!!!!
> U might want to do a type cast to integer from string...
>
> http://www.php.net/manual/en/language.types.type-juggling.php
>
>
> On Mon, 2003-01-27 at 13:47, Scott Fletcher wrote:
> > I would need to use intval() to solve this problem....
> >
> > "Scott Fletcher" <scott@abcoa.com> wrote in message
> > news:20030127203003.23873.qmail@pb1.pair.com...
> > > I'm referring to '08' and '09' that don't work....
> > >
> > > "Chris Shiflett" <shiflett@php.net> wrote in message
> > >
> > > news:20030127202202.46876.qmail@web14306.mail.yahoo.com...
> > > > --- Scott Fletcher <scott@abcoa.com> wrote:
> > > > > Found a PHP bug
> > > > ...
> > > > > if ($month == 01)
> > > >
> > > > I guess you mean:
> > > >
> > > > if ($month == '01')
> > > >
> > > > If so, this is not a bug. Otherwise, please explain what
> > > > you think is wrong.
> > > >
> > > > Chris
> > >
> > >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>