Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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: 11 October 2026