Edit report at https://bugs.php.net/bug.php?id=72543&edit=1
ID: 72543
Patch added by: dmitry@php.net
Reported by: tony2001@php.net
Summary: different references behavior comparing to 5.5
Status: Assigned
Type: Bug
Package: Scripting Engine problem
Operating System: *
PHP Version: 7.1.0alpha1
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: bug72543_2.diff
Revision: 1467748668
URL: https://bugs.php.net/patch-display.php?bug=72543&patch=bug72543_2.diff&revision=1467748668
Previous Comments:
------------------------------------------------------------------------
[2016-07-05 11:19:59] laruence@php.net
does your patch also take care of
$arr = 'b';
$$arr['b']['b'] = $b['b']; ?
------------------------------------------------------------------------
[2016-07-05 10:45:34] dmitry@php.net
The following patch has been added/updated:
Patch Name: bug72543.diff
Revision: 1467715534
URL: https://bugs.php.net/patch-display.php?bug=72543&patch=bug72543.diff&revision=1467715534
------------------------------------------------------------------------
[2016-07-05 09:58:48] dmitry@php.net
Before execution of the following statement $copy['b'] is a "dead" REFERENCE
with refcount==1.
$copy['b']['b'] = $copy['b'];
Right-side expression evaluated first, and incrementats REFERENCE refcount (it became 2). After
that, it starts to behave as a real REFERENCE and is not separated during left-side expression
evaluation.
------------------------------------------------------------------------
[2016-07-05 03:17:14] laruence@php.net
yeah, I agree with that, but if cheaper fix is mess, than I prefer a clear one, besides, one
UNEXPECT check should not change anything in performance.
------------------------------------------------------------------------
[2016-07-04 17:02:10] dmitry@php.net
In general, you fix is right, but it introduces an extra check on fast path, that is useless in
almost all cases. I'll try to find a cheaper solution.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=72543
--
Edit this bug report at https://bugs.php.net/bug.php?id=72543&edit=1