Bug #69159 [NEW]: Opcache causes problem when passing a variable variable to a function

From: Date: Mon, 02 Mar 2015 15:09:07 +0000
Subject: Bug #69159 [NEW]: Opcache causes problem when passing a variable variable to a function
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191046@lists.php.net to get a copy of this message
From:             seb at rootsandrain dot com
Operating system: CentOS
PHP version:      5.6.6
Package:          opcache
Bug Type:         Bug
Bug description:Opcache causes problem when passing a variable variable to a function

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

-- 
Edit bug report at https://bugs.php.net/bug.php?id=69159&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=69159&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=69159&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=69159&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=69159&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=69159&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=69159&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=69159&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=69159&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=69159&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=69159&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=69159&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=69159&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=69159&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69159&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=69159&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=69159&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=69159&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69159&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=69159&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=69159&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#191046) next »