Bug #78341 [Opn]: Opcache DFA pass over-optimized?
| From: | jfcherng at gmail dot com | Date: | Sun, 28 Jul 2019 12:30:18 +0000 |
| Subject: | Bug #78341 [Opn]: Opcache DFA pass over-optimized? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-221958@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78341&edit=1
ID: 78341
User updated by: jfcherng at gmail dot com
Reported by: jfcherng at gmail dot com
Summary: Opcache DFA pass over-optimized?
Status: Open
Type: Bug
Package: opcache
Operating System: Win7 x64
PHP Version: 7.3.8RC1
Block user comment: N
Private report: N
New Comment:
Line 268: https://github.com/symfony/var-dumper/blob/v4.3.3/Cloner/VarCloner.php#L268
"zvalIsRef" is defined in: https://github.com/symfony/var-dumper/blob/v4.3.3/Cloner/VarCloner.php#L84-L89
Previous Comments:
------------------------------------------------------------------------
[2019-07-28 12:26:33] jfcherng at gmail dot com
Description:
------------
PHP 7.3.8RC1 (and 7.4snapshot) emits notices after I update symfony/var-dumper to v4.3.3 today.
"zvalIsRef in vendor\symfony\var-dumper\Cloner\VarCloner.php on line 268"
The variable "zvalIsRef" around VarCloner.php on line 268 is actually obviously defined.
So I have much confidence this is a PHP engine's problem.
After some tests, this seems to be the problematic commit https://github.com/php/php-src/commit/e7a83ec8dff962ea624508f18b9b10f5add030cc
. It's parent 3fa9f9cfae2cedd7b6d26b6487dd156321243ab7 works fine in my test.
I am sorry that I am not able to give a smaller test case.
Test script:
---------------
<?php
declare(strict_types=1);
// remember to set opcache.enable_cli=1 if this test is done in cli
// composer require symfony/var-dumper:v4.3.3
require __DIR__ . '/vendor/autoload.php';
use Symfony\Component\VarDumper\Cloner\VarCloner;
$myVar = new ArrayObject();
$cloner = new VarCloner();
$data = $cloner->cloneVar($myVar);
Expected result:
----------------
no notice is emitted.
Actual result:
--------------
Notice: Undefined variable: zvalIsRef in vendor\symfony\var-dumper\Cloner\VarCloner.php on line 268
Notice: Undefined variable: zvalIsRef in vendor\symfony\var-dumper\Cloner\VarCloner.php on line 268
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78341&edit=1