Re: Interesting result

From: Date: Sat, 21 Dec 2002 14:17:03 +0000
Subject: Re: Interesting result
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-92741@lists.php.net to get a copy of this message
It doesn't matter because the behavior here is undefined just like in C. You can't use a variable and it's post/pre increment value in the same expression. Andi At 03:26 PM 12/21/2002 +0200, Andrey Hristov wrote:
Hi, i got an interesting case : <?php $a = 1; var_dump($a + $a++); $a = 1; $x = &$a; var_dump($a + $a++); ?> Result int(2) int(3) Can somebody explain why if there is reference to the var the result is different? Andrey -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.dev (#92741) next »