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 (profile)
Status: Closed Package: opcache
PHP Version: 5.6.6 OS: CentOS
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: seb at rootsandrain dot com
New email:
PHP Version: OS:

 

 [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
 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 08 03:01:27 2024 UTC