Re: [PHP-DEV] PHP 4.0 Bug #5331: ++ operator From: Andi Gutmans (andi <email protected>)
Date: 07/01/00

Can you do var_dump($newkey) after the list() line and tell us what the
output is? My guess is that $newkey isn't an integer and therefore it is
behaving differently than you expect it to behave. Might be a misfeature
but then again it might not. Once we know what the type is we can think if
what's happening makes sense or not.

Andi

At 05:23 PM 7/2/00 +0000, zork <email protected> wrote:
>From: zork <email protected>
>Operating system: Linux (Slackware 7.0)
>PHP version: 4.0.0
>PHP Bug Type: Scripting Engine problem
>Bug description: ++ operator
>
>Deep in my program I have such fragment:
>
>list($newkey) = $db -> getrow();
>$newkey++;
>$data[$key] = $newkey;
>
>And $newkey++ doesn't work!
>If i change
>
>$newkey++;
>
>to
>
>$newkey = $newkey + 1;
>
>everything is fine - newkey gets incremented. But It doesn't with ++ operator.
>
>Don't have time now to shrink the code to the smallest one that produce
>this behaviour and to upgarde to 4.0.1 - I will do it in one or two weeks.
>
>regards
>Łukasz Michalski.
>
>
>--
>PHP Development Mailing List <http://www.php.net/>
>To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
>For additional commands, e-mail: php-dev-help <email protected>
>To contact the list administrators, e-mail: php-list-admin <email protected>

---
Andi Gutmans <andi <email protected>>
http://www.zend.com/

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>