Bug #77691 [Asn->Csd]: Opcache passes wrong value for inline array push assignments

From: Date: Mon, 04 Mar 2019 12:16:45 +0000
Subject: Bug #77691 [Asn->Csd]: Opcache passes wrong value for inline array push assignments
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219832@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77691&edit=1 ID: 77691 Updated by: nikic@php.net Reported by: d dot penning at stroeermediabrands dot de Summary: Opcache passes wrong value for inline array push assignments -Status: Assigned +Status: Closed Type: Bug Package: opcache Operating System: Debian 4.9 PHP Version: 7.2.15 Assigned To: nikic Block user comment: N Private report: N New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2019-03-04 10:48:45] 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" } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77691&edit=1

« previous php.bugs (#219832) next »