Bug #73847 [Fbk->Ver]: Recursion when a variable is redefined as array

From: Date: Sat, 31 Dec 2016 12:16:01 +0000
Subject: Bug #73847 [Fbk->Ver]: Recursion when a variable is redefined as array
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206262@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73847&edit=1 ID: 73847 Updated by: nikic@php.net Reported by: joyce at ennexa dot com Summary: Recursion when a variable is redefined as array -Status: Feedback +Status: Verified Type: Bug Package: Arrays related PHP Version: 7.1.0 -Assigned To: cmb +Assigned To: Block user comment: N Private report: N New Comment: It's an opcache optimizer problem. Wrap it in a function to reproduce: <?php function test() { $a = 23; $a = array($a); print_r($a); } test(); Previous Comments: ------------------------------------------------------------------------ [2016-12-31 12:04:18] cmb@php.net I can't reproduce that: <https://3v4l.org/6p5r1>. Please specify the exact version of PHP you're using, which zend_extensions are enabled, and your OS. ------------------------------------------------------------------------ [2016-12-31 07:28:36] joyce at ennexa dot com Description: ------------ Redefining a variable as an array with the old value as member causes recursion. Test script: --------------- <?php $a = 23; $a = array($a); print_r($a); Expected result: ---------------- Array ( [0] => 23 ) Actual result: -------------- Array ( [0] => Array *RECURSION* ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73847&edit=1

« previous php.bugs (#206262) next »