Bug #71999 [Opn->Dup]: Array references inside switch regression

From: Date: Sat, 09 Apr 2016 23:01:16 +0000
Subject: Bug #71999 [Opn->Dup]: Array references inside switch regression
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200463@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71999&edit=1 ID: 71999 Updated by: nikic@php.net Reported by: albertcasademont at gmail dot com Summary: Array references inside switch regression -Status: Open +Status: Duplicate Type: Bug Package: Arrays related Operating System: Debian 8.5 PHP Version: 7.0.5 Block user comment: N Private report: N New Comment: Duplicate of bug #71914. This will be fixed in PHP 7.0.6. Previous Comments: ------------------------------------------------------------------------ [2016-04-09 20:50:16] albertcasademont at gmail dot com You can also check it here https://3v4l.org/5dWuf ------------------------------------------------------------------------ [2016-04-09 20:48:33] albertcasademont at gmail dot com Description: ------------ In PHP 7.0.4 the script below worked correctly, the result was TRUE. It's not the case in PHP 7.0.5 it seems that the reference inside the switch and case statements is not working correctly. Test script: --------------- <?php function bar(&$b) { switch ($b) { case 'bar': $b = null; } } $a = ['foo' => 'bar']; bar($a['foo']); var_dump(null === $a['foo']); Expected result: ---------------- bool(true) Actual result: -------------- bool(false) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71999&edit=1

« previous php.bugs (#200463) next »