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

Home » Imported messages » comp.lang.php » why is it always an endless loop?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: why is it always an endless loop? [message #186155 is a reply to message #186140] Mon, 16 June 2014 19:41 Go to previous messageGo to previous message
Christoph Michael Bec is currently offline  Christoph Michael Bec
Messages: 207
Registered: June 2013
Karma:
Senior Member
Am 16.06.2014 18:06, schrieb richard:
>
> $a="one"
> $b="one"
>
> while ($a=$b){echo "equal"; $b="two";)
>
> This simple code causes an endless loop.
> Why?
>
> As soon as $b is changed, they are no longer equal, yet the loop continues.
> This does not happen in BASIC.
> If it is placement, where then should $b be placed?

You may consider using a lint tool, such as
<http://www.icosaedro.it/phplint/phplint-on-line.html>. Parsing your
code with it points out 4 problems.

--
Christoph M. Becker
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to loop through the dates?
Next Topic: Authentication Framework?
Goto Forum:
  

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

Current Time: Thu Nov 28 16:39:38 GMT 2024

Total time taken to generate the page: 0.04232 seconds