|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
49 + 6 = ?
Subscribe to this entry?

 [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-2023 The PHP Group
All rights reserved.
Last updated: Mon Dec 11 12:01:28 2023 UTC