|  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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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-2022 The PHP Group
All rights reserved.
Last updated: Sun Oct 02 00:05:51 2022 UTC