|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72077 Passing reference variables breaks if that variable is used in a switch.
Submitted: 2016-04-22 14:33 UTC Modified: 2016-04-22 14:40 UTC
From: robertdesarbo at gmail dot com Assigned:
Status: Closed Package: Variables related
PHP Version: 7.0.5 OS: CentOS 7
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: robertdesarbo at gmail dot com
New email:
PHP Version: OS:


 [2016-04-22 14:33 UTC] robertdesarbo at gmail dot com
If you pass a variable as a reference to a function and use that variable in a switch then the variable will not update outside the function.  This worked in 7.0.4 but is not working in 7.0.5.

Test script:
$var = 'WHAT_IS_THIS';
    public function __construct() {}
    public function do_it( &$data )
            case 'WHAT_IS_THIS':
                $data = "I_WORK";
                $retFlag = false;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-22 14:40 UTC] robertdesarbo at gmail dot com
-Status: Open +Status: Closed
 [2016-04-22 14:40 UTC] robertdesarbo at gmail dot com
Ignore this, duplicate of
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 31 16:01:27 2021 UTC