Re: Friday - Return of Brain Teasers

From: Date: Sat, 06 Oct 2012 08:43:06 +0000
Subject: Re: Friday - Return of Brain Teasers
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-319383@lists.php.net to get a copy of this message
On 06.10.2012 03:08, Tamara Temple wrote:
On Fri, 2012-10-05 at 22:50 +0200, iostream wrote:
If you want to execute some code... I'm sure you've all heard of the new "goes to" operator by now, but I hope it might be new to somebody.
    $i = 10;
    while ($i --> 0) { // while $i goes to 0
      echo $i ."\n";
    }
Okay, I haven't heard of it, and I don't get it. AFAIK, this "operator" does not exist, but I don't get the trick that's being applied. while ($i-- > 0)
should clearify things

« previous php.general (#319383) next »