Strange –> Operator

By Andrew Schmelyun

<?php

$i = 10;

while( $i --> 0) {
    print $i . ', ';

}

This PHP code is valid. It works because of the way operator syntax is parsed: it’s another way of writing while ($i-- > 0): the spaces are not important in this syntax. The result is a very visual way to explain what the loop is doing.

See Also

PHP Features

Last updated: 14 July 2026