|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-12-31 07:28 UTC] 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*
)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 07:00:02 2025 UTC |
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();