"Bogdan Stancescu" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 2. print $letter++ -- why doesn't this evaluate to "b" at the first loop
when
> it's already 'a'? Ok, this I may be able to explain because it's neither
"print
> ++$letter" nor "print ($letter++)", but I wouldn't have trusted this
syntax to
> work this way a million years!
>

$foo++ is 'postfix', ++$foo is 'prefix' This means that the addition of 1
occurs AFTER (hence post) the expression's value is returned, not before.

In other words, it's equivalent to this:
print $foo;
$foo = $foo + 1;

not this:
$foo = $foo + 1;
print $foo;

-- Daniel Grace




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to