|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-04-29 06:48 UTC] requinix@php.net
-Status: Open
+Status: Feedback
[2019-04-29 06:48 UTC] requinix@php.net
[2019-04-29 07:53 UTC] nicolas dot grekas+php at gmail dot com
-Status: Feedback
+Status: Open
[2019-04-29 07:53 UTC] nicolas dot grekas+php at gmail dot com
[2019-04-29 08:07 UTC] nikic@php.net
-Assigned To:
+Assigned To: nikic
[2019-04-29 08:07 UTC] nikic@php.net
[2019-04-29 08:23 UTC] nicolas dot grekas+php at gmail dot com
[2019-05-09 10:02 UTC] nikic@php.net
-Summary: ReflectionReference bugs recounting
+Summary: ReflectionReference should return null for rc=1
reference
[2019-05-09 10:03 UTC] nikic@php.net
[2019-05-09 10:03 UTC] nikic@php.net
-Status: Assigned
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 04:00:01 2025 UTC |
Description: ------------ ReflectionReference must have a bug with zval that have is_ref=1 but refcount=1 Test script: --------------- $a = [1, 2]; foreach ($a as &$v) { } // This should return null but instead it returns a ReflectionReference. // a few lines below, $b[0] becomes a reference to $a[0] // while this is not the case when this line is commented. $r = ReflectionReference::fromArrayElement($a, 0); $b = $a; $b[0] = 123; var_dump($a); var_dump($b); Expected result: ---------------- array(2) { [0]=> int(1) [1]=> &int(2) } array(2) { [0]=> int(123) [1]=> &int(2) } Actual result: -------------- array(2) { [0]=> &int(123) [1]=> &int(2) } array(2) { [0]=> &int(123) [1]=> &int(2) }