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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: d dot penning at stroeermediabrands dot de
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Thu Nov 21 11:01:29 2024 UTC