|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71999 Array references inside switch regression
Submitted: 2016-04-09 20:48 UTC Modified: 2016-04-09 23:01 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: albertcasademont at gmail dot com Assigned:
Status: Duplicate Package: Arrays related
PHP Version: 7.0.5 OS: Debian 8.5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: albertcasademont at gmail dot com
New email:
PHP Version: OS:


 [2016-04-09 20:48 UTC] albertcasademont at gmail dot com
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:

function bar(&$b)
    switch ($b) {
        case 'bar':
            $b = null;

$a = ['foo' => 'bar'];


var_dump(null === $a['foo']);

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-09 20:50 UTC] albertcasademont at gmail dot com
You can also check it here
 [2016-04-09 23:01 UTC]
-Status: Open +Status: Duplicate
 [2016-04-09 23:01 UTC]
Duplicate of bug #71914. This will be fixed in PHP 7.0.6.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 15:01:29 2024 UTC