Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Stephan Jaschke Newsgroups: comp.lang.php Subject: Re: why is it always an endless loop? Date: Mon, 16 Jun 2014 18:19:57 +0200 Lines: 16 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: individual.net tJKOL9Yo/qoIRAwYvFOQxgxEcRw9rnrRtefGjwvkeHA3uu076M Cancel-Lock: sha1:Rw4Cbe6CBWKO+5vD2qxJjXMhJj4= User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: X-Enigmail-Version: 1.6 Xref: csiph.com comp.lang.php:13878 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? > = != == :-) SCNR