#43802 [Opn->Bgs]: Differences between asigned references in PHP4 and PHP5
| From: | bjori@php.net | Date: | Thu, 10 Jan 2008 00:06:08 +0000 |
| Subject: | #43802 [Opn->Bgs]: Differences between asigned references in PHP4 and PHP5 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-121168@lists.php.net to get a copy of this message | ||
ID: 43802
Updated by: bjori@php.net
Reported By: fkieber at free dot fr
-Status: Open
+Status: Bogus
Bug Type: Variables related
Operating System: Linux
PHP Version: 5.2.5
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
Turn on E_STRICT
Previous Comments:
------------------------------------------------------------------------
[2008-01-09 23:51:43] fkieber at free dot fr
Sorry.
Expected result should be :
Output in PHP4
var=12
var=15
var=12
var=15
And Actual result is :
Output in PHP5
var=12
var=15
var=2
var=5
------------------------------------------------------------------------
[2008-01-09 23:46:13] fkieber at free dot fr
Description:
------------
Same as bug #38013 but different behaviour between PHP 4.3.10 and 5.2.5
Reproduce code:
---------------
<?php
function change (&$var) {
$var += 10;
}
$var = 1;
++$var;
change($var);
echo "var=$var";
$var = 5;
change($var);
echo "var=$var";
$var = 1;
change(++$var);
echo "var=$var";
change($var = 5);
echo "var=$var";
?>
Expected result:
----------------
That one from php 4 :
var=12
var=12
Actual result:
--------------
in PHP 5:
var=12
var=2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43802&edit=1