Opcache causes problem when passing a variable variable to a function

Bug #69159 Opcache causes problem when passing a variable variable to a function
Submitted: 2015-03-02 15:09 UTC Modified: 2015-03-04 06:19 UTC
From: seb at rootsandrain dot com Assigned: laruence (profile)
Status: Closed Package: opcache
PHP Version: 5.6.6 OS: CentOS
Private report: No CVE-ID: None

 [2015-03-02 15:09 UTC] seb at rootsandrain dot com

Description:
------------
After upgrading from 5.5.22 to 5.6.6 the script failed to operate correctly, churning out "Notice: undefined variable" errors on the function call line.

Disabling opcache fixes the problem.

Sadly the short version I've posted here doesn't appear to exhibit the problem, and I don't have time to anonymise the much larger section of code that's been breaking.

Nevertheless, it was 100% the call to "myFunction" that was giving a Notice undefined variable error.

Test script:
---------------
$i=1;
${"sR{$i}S1"} = 'hello';
${"nR{$i}S1P"} = 'world';

myFunction(${"sR{$i}S1"}, ${"nR{$i}S1P"});

function myFunction($x, $y) {
    echo "$x $y";
}

Expected result:
----------------
echos

"hello world"

Actual result:
--------------
Notice: undefined variable

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports