Bug #65589 [Opn->Nab]: PHP Language BUG

From: Date: Fri, 30 Aug 2013 20:45:11 +0000
Subject: Bug #65589 [Opn->Nab]: PHP Language BUG
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-181373@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65589&edit=1 ID: 65589 Updated by: aharvey@php.net Reported by: wwwgying at qq dot com Summary: PHP Language BUG -Status: Open +Status: Not a bug Type: Bug -Package: PHPScript +Package: Scripting Engine problem Operating System: Windows/Mac/Linux PHP Version: 5.5.3 Block user comment: N Private report: N New Comment: This is undefined behaviour in PHP, as in most languages with C-derived syntaxes. Mailing list discussion from last month: http://marc.info/?t=137427934300002&r=1&w=2 This is also documented, see example 1 on: http://www.php.net/manual/en/language.operators.precedence.php Previous Comments: ------------------------------------------------------------------------ [2013-08-30 08:17:54] wwwgying at qq dot com Description: ------------ <?php $a=1; $c=$a+$a+$a++; var_dump($c); $a=1; $c=$a+$a++; var_dump($c); ?> we will get int(3) int(3) and the same code,php result is not the same with other program languages. Test script: --------------- <?php $a=1; $c=$a+$a+$a++; var_dump($c); $a=1; $c=$a+$a++; var_dump($c); ?> Expected result: ---------------- int(3) int(3) Actual result: -------------- int(3) int(2) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=65589&edit=1

« previous php.bugs (#181373) next »