FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » strange behaviour in assignment expr.
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: strange behaviour in assignment expr. [message #172850 is a reply to message #172849] Sat, 05 March 2011 13:29 Go to previous messageGo to previous message
Marc van Lieshout is currently offline  Marc van Lieshout
Messages: 10
Registered: March 2011
Karma:
Junior Member
On 05-03-11 14:20, Jerry Stuckle wrote:
> On 3/5/2011 8:02 AM, Marc van Lieshout wrote:
>> I try to read in a source file, line by line, within a loop
>>
>> This works:
>>
>> $text = fgets($fh);
>> if ($text === false)
>> break;
>>
>> This doesn't, and always breaks on the first line:
>>
>> if (($text = fgets($fh)) === false)
>> break;
>>
>> What's wrong with that? Am I missing something?
>
> It should work. Check your code again. I suspect you may be using
> "==", which will break on an empty string, instead of "===", which
> will not.
>
No, I copypasted. There are three = there.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: [ANN]VTD-XML 2.10
Next Topic: having trouble using gd imageline in foreach loop
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 02:21:22 GMT 2024

Total time taken to generate the page: 0.16702 seconds