Re: ++ BUG??

From: Date: Sun, 26 Nov 2000 04:24:00 +0000
Subject: Re: ++ BUG??
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-27227@lists.php.net to get a copy of this message
> My point is that this should not be undefined behavior because the PHP manual > says "C-style ... operators". The behavior in C is very well-defined. > Therefore there is either a problem in the Zend compiler or executor, or in > the PHP manual. And to me this looks like a problem in the compiler or > executor. I tested it in C and you're right, it is indeed well defined. I was slightly off in my interpretation of when, exactly, the ++ operators increment the variable. I thought it was after the use of the variable, not after the entire statement is finished. So I'll concede that it's a bug if they're going for C-style behavior. All I was trying to say, though, was that it's bad code and the bug is easily avoided :)

« previous php.general (#27227) next »