|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
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
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

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



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

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

Actual result:
array(0) {
array(1) {
  string(4) "test"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-03-04 11:50 UTC]
-Assigned To: +Assigned To: nikic
 [2019-03-04 12:16 UTC]
Automatic comment on behalf of
Log: Fixed bug #77691
 [2019-03-04 12:16 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri May 29 17:01:40 2020 UTC