php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77691 Opcache passes wrong value for inline array push assignments
Submitted: 2019-03-04 10:48 UTC Modified: 2019-03-04 11:50 UTC
From: d dot penning at stroeermediabrands dot de Assigned: nikic (profile)
Status: Closed Package: opcache
PHP Version: 7.2.15 OS: Debian 4.9
Private report: No CVE-ID: None
 [2019-03-04 10:48 UTC] d dot penning at stroeermediabrands dot de
Description:
------------
If an inline assignment to append a value to an array is used as argument opcache passes the array instead of the assigned value to the function.

This works as expected when opcache is disabled.

Test script:
---------------
<?php // a.php
include('b.php');

function a()
{
    var_dump($array = [], b($array[] = 'test'));
}

a();

--------

<?php // b.php
function b($str)
{
    return $str;
}


Expected result:
----------------
array(0) {
}
string(4) "test"

Actual result:
--------------
array(0) {
}
array(1) {
  [0]=>
  string(4) "test"
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-03-04 11:50 UTC] nikic@php.net
-Assigned To: +Assigned To: nikic
 [2019-03-04 12:16 UTC] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3f00c9367d080bfa6153d6c7673f3ca4fad73c31
Log: Fixed bug #77691
 [2019-03-04 12:16 UTC] nikic@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC