Re: Snarl, hiss, growl (frustration)
| From: | Rasmus Lerdorf | Date: | Fri, 04 Jul 2003 17:13:38 +0000 |
| Subject: | Re: Snarl, hiss, growl (frustration) | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-154012@lists.php.net to get a copy of this message | ||
On Fri, 4 Jul 2003, Robert Cummings wrote:
> On Fri, 2003-07-04 at 12:44, Rasmus Lerdorf wrote:
> > The difference is that you are getting a string from the file and not
> > casting it to an integer. You could also have fixed it by doing:
> >
> > $counter = (int) fread(...);
>
> The cast isn't necessary, PHP happily transforms it for him when he
> applies the ++ operator.
;) You are sure about that right? Or else you wouldn't have posted this
to 1000's of people.
So what do you think this will output?
$a = "123\n";
$a++;
echo $a;
Try it.
-Rasmus