php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
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
Status: Closed Package: opcache
PHP Version: 5.6.6 OS: CentOS
Private report: No CVE-ID:
 [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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-04 06:19 UTC] laruence@php.net
-Assigned To: +Assigned To: laruence
 [2015-03-04 06:49 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a29b64fc1029b4121e3e9ff20901c35ad600b4da
Log: Fixed bug #69159 (Opcache causes problem when passing a variable variable to a function)
 [2015-03-04 06:49 UTC] laruence@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC