|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-01-06 22:06 UTC] pagescene at gmail dot com
[2017-01-06 22:15 UTC] nikic@php.net
-Status: Open
+Status: Duplicate
[2017-01-06 22:15 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Fri Jan 02 08:00:01 2026 UTC |
Description: ------------ Hello everyone! This bug reproduced only on PHP 7.1.0 with enabled Opcache (PHP 5.6 and PHP 7.0 not affected). See test script. (Run twice or more for reproduce. First run begin not from cache and the script will work correctly). Test script: --------------- <?php class Test { public function didIt() { $v = 2; $v = array($v); var_dump($v); } } (new Test())->didIt(); // RETURN array(1) { [0]=> array(1) { [0]=> *RECURSION* } } $testFunction = function () { $v = 2; $v = array($v); var_dump($v); }; $testFunction(); // RETURN array(1) { [0]=> array(1) { [0]=> *RECURSION* } } $v = 2; $v = array($v); var_dump($v); // RETURN array(1) { [0]=> int(2) }