Bug #71999 [Com]: Array references inside switch regression
| From: | albertcasademont at gmail dot com | Date: | Sat, 09 Apr 2016 20:50:16 +0000 |
| Subject: | Bug #71999 [Com]: Array references inside switch regression | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-200462@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
Comment by: albertcasademont at gmail dot com
Reported by: albertcasademont at gmail dot com
Summary: Array references inside switch regression
Status: Open
Type: Bug
Package: Arrays related
Operating System: Debian 8.5
PHP Version: 7.0.5
Block user comment: N
Private report: N
New Comment:
You can also check it here
https://3v4l.org/5dWuf
Previous Comments:
------------------------------------------------------------------------
[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