Bug #71010 [Ver->Nab]: Result of the program is not correct while the variable assignment by reference
| From: | laruence@php.net | Date: | Sat, 05 Dec 2015 15:38:27 +0000 |
| Subject: | Bug #71010 [Ver->Nab]: Result of the program is not correct while the variable assignment by reference | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-197619@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71010&edit=1
ID: 71010
Updated by: laruence@php.net
Reported by: miaojuanfeng at qq dot com
Summary: Result of the program is not correct while the
variable assignment by reference
-Status: Verified
+Status: Not a bug
Type: Bug
Package: Scripting Engine problem
Operating System: linux
PHP Version: 5.6Git-2015-12-01 (Git)
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
this is an undefined behavior, as in php the sequence point definition is similar as C.
Previous Comments:
------------------------------------------------------------------------
[2015-12-02 07:13:10] miaojuanfeng at qq dot com
I have pull two request at github:
Fixed bug #71010 ï¼part 1
Fixed bug #71010 ï¼part 2
something failed. Hm...may be I don't know how to use github.
I believe my code is correct.
------------------------------------------------------------------------
[2015-12-02 07:13:10] miaojuanfeng at qq dot com
Related To: Bug #71010
------------------------------------------------------------------------
[2015-12-02 07:13:10] miaojuanfeng at qq dot com
Related To: Bug #71010
------------------------------------------------------------------------
[2015-12-01 21:20:19] requinix@php.net
Fixed in PHP 7. https://3v4l.org/GnfFs
Where is your pull request?
------------------------------------------------------------------------
[2015-12-01 15:59:01] miaojuanfeng at qq dot com
Description:
------------
Hi, I'm chinese, I do my best to let each other understand. :)
result of the program is not correct while the variable assignment by reference.
I have fixed the bug and pull request at github.
Test script:
---------------
$a = 1;
$b = &$a;
$c = (++$a)+(++$a)+(++$a);
echo $c;
Expected result:
----------------
9
Actual result:
--------------
10
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71010&edit=1