Re: Friday - Return of Brain Teasers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux