1--TEST-- 2JIT FETCH_DIM_W: 004 3--INI-- 4opcache.enable=1 5opcache.enable_cli=1 6opcache.file_update_protection=0 7--FILE-- 8<?php 9function create_references(&$array) { 10 foreach ($a as $key => $value) { 11 create_references($array[$key]); 12 } 13} 14 15function change_copy($copy) { 16 $copy['b']['z']['z'] = $copy['b']; 17} 18 19$data = [ 20 'a' => [ 21 'b' => [], 22 ], 23]; 24 25@create_references($data); 26 27$copy = $data['a']; 28var_dump($copy); 29 30change_copy($copy); 31var_dump($copy); //RECURSION 32?> 33--EXPECT-- 34array(1) { 35 ["b"]=> 36 array(0) { 37 } 38} 39array(1) { 40 ["b"]=> 41 array(0) { 42 } 43} 44