Bug #71914 [Opn->Csd]: Reference is lost in case

From: Date: Tue, 29 Mar 2016 09:15:04 +0000
Subject: Bug #71914 [Opn->Csd]: Reference is lost in case
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200202@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71914&edit=1 ID: 71914 Updated by: laruence@php.net Reported by: laruence@php.net Summary: Reference is lost in case -Status: Open +Status: Closed Type: Bug Package: Scripting Engine problem PHP Version: 7.0.4 Block user comment: N Private report: N New Comment: Automatic comment on behalf of laruence@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=2e6d70787c93413daecbea529bf0f74fa901d1db Log: Fixed bug #71914 (Reference is lost in &quot;switch&quot;) Previous Comments: ------------------------------------------------------------------------ [2016-03-29 09:11:25] laruence@php.net Description: ------------ thanks for the ssh access by Spritz, reference is lost after case statement. Test script: --------------- <?php function bug(&$value) { switch ($value) { case "xxxx": $value = true; break; } } function test($arr, &$dummy) { bug($arr["str"]); var_dump($arr); } $array = array("str" => "xxxx"); test($array, $array["str"]); Expected result: ---------------- true Actual result: -------------- string(4) "xxxx" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71914&edit=1

« previous php.bugs (#200202) next »