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 :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Return to the default flat view Create a new topic Submit Reply
why is it always an endless loop? [message #186140] Mon, 16 June 2014 12:06 Go to previous message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma:
Senior Member
add to buddy list
ignore all messages by this user
$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?
[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: Sat Dec 16 15:25:54 EST 2017

Total time taken to generate the page: 0.00714 seconds