On Wed, 10 Jan 2001, Cynic wrote:
> I recently needed to process every other element of a
> numerically indexed array.
> for( $i = 0 ; $i < count( $a ) ; $x = $a[ ++$i++ ] )
> would have saved me one statement. I had to use
> for( $i = 0 ; $i < count( $a ) ; $x = $a[ $i++ ] , $i++ )
> I know,
yes, I meant: "increment $i, assign $a[ $i ] to $x, and then
increment once more.
ok, then, let's forget it.
At 14:07 10.1. 2001, Zeev Suraski wrote the following:
--
>At 15:01 10/1/2001, Cynic wrote:
>>would have saved me one statem
At 15:01 10/1/2001, Cynic wrote:
>would have saved me one statement. I had to use
>for( $i = 0 ; $i < count( $a ) ; $x = $a[ $i++ ] , $i++ )
This is a very weird and uncommon piece of code. If it's indeed correct
(which I doubt - do you want to increment it by two?) then a more common &
unders
C>> Well, this would be probably completely useless (at least I
C>> can't think of a meaningful use of this right now), but... is
C>> there a reason this can't be implemented in PHP? I know, time
Well, I guess you answered your own question :) If it's useless, that's
pretty much the reason not
I recently needed to process every other element of a
numerically indexed array.
for( $i = 0 ; $i < count( $a ) ; $x = $a[ ++$i++ ] )
would have saved me one statement. I had to use
for( $i = 0 ; $i < count( $a ) ; $x = $a[ $i++ ] , $i++ )
I know, this is an 'issue' so tiny I can laugh at it,
Could you explain how this construct is useful? I can't think of any real
world situation in which it's useful or even remotely makes sense. What
would it even do? Remember, an expression has only one value.
Zeev
At 14:51 10/1/2001, Cynic wrote:
>Well, this would be probably completely usel
Well, this would be probably completely useless (at least I
can't think of a meaningful use of this right now), but... is
there a reason this can't be implemented in PHP? I know, time
is a very precious commodity, and I wouldn't ask (or suggest)
for an implementation of this if it would requir